Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

corrade.containers.BitArrayView class

Bit array view

Comparex to an ArrayView, which operates with byte-sized types, provides a view on individual bits. Convertible from a BitArrayView. See StridedBitArrayView1D and others for more generic bit views. BitArrayView is immutable, see MutableBitArrayView for the mutable alternative. All slicing operations are supported, specifying a non-trivial stride will return a StridedBitArrayView1D instead of a BitArrayView.

Memory ownership and reference counting

Similarly to ArrayView, the view keeps a reference to the original memory owner object in the owner field. Slicing a view creates a new view referencing the same original object, without any dependency on the previous view. The owner is None if the view is empty.

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 __init__(self, array: BitArray) -> None
Construct a view on a bit array
def __len__(self, /) -> int
Size in bits

Properties

offset: int get
Bit offset
owner: object get
Memory owner object