class
BitArrayBit array
An owning counterpart to BitArrayView / MutableBitArrayView. Holds its own data buffer, thus doesn’t have an equivalent to BitArrayView.owner. Implicitly convertible to BitArrayView, MutableBitArrayView, StridedBitArrayView1D and MutableStridedBitArrayView1D, so all APIs consuming (strided) bit array views work with this type as well.
Static methods
- def direct_init(size: int, value: bool) -> BitArray
- Construct an array initialized to a particular bit value
- def no_init(size: int) -> BitArray
- Construct an array without initializing its contents
- def value_init(size: int) -> BitArray
- Construct a zero-initialized array
Special methods
- def __getitem__(self, i: int) -> bool
- Bit at given position
- def __getitem__(self, slice: slice) -> object
- Slice the view
- def __init__(self, /) -> None
- Default constructor
- def __len__(self, /) -> int
- Size in bits
- def __setitem__(self, i: int, value: bool) -> None
- Set a bit at given position