Skip to main content

A pure-Python memory-efficient packed representation for bit arrays

Project description

This class presents a pure-Python memory efficient packed representation for bit arrays.

In version 1.4.1, the reset() method now returns ‘self’ to allow for cascaded inovocation with the slicing operator. This version also removes the discrepancy between the value of the __copyright__ variable in the module and the value of license variable in

Version 1.4 supports slice assignment and a reset method that allows a previously constructed bit vector to be reinitialized to all 0’s or all 1’s. The code was also cleaned up with pychecker for this version.

The class supports the following operators/methods:










__eq__, __ne__, __lt__, __le__, __gt__, __ge__

‘|’ for bitwise or

‘&’ for bitwise and

‘^’ for bitwise xor

‘~’ for bitwise inversion

‘<<’ for circular shift to the left

‘>>’ for circular shift to the right

‘+’ for concatenation

intValue(), __int__ for returning the integer value










slice assignment


Project details

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page