class Array(val: tuple = None)

Bases: list

Generic container datatype that holds N instances of type T

Generic parameters:

T: Type of the Array [T, N] elements

N: Number of elements in the Array [T, N]

Concrete data type is obtained by indexing:

u16_4 = Array[Uint[16], 4]

Return a shallow copy of the list.

class ArrayType

Bases: pygears.typing.base.EnumerableGenericMeta


Returns a list of keys that can be used for indexing Array [T, N] type. Number of keys equals to the number of elements N.

>>> Array[Uint[2], 5].keys()
[0, 1, 2, 3, 4]
property width

Calculates the bit width of the type.

>>> int(Tuple[Uint[1], Uint[2]])