ID EN
Built-in Types

itemsize

Python 3.11

The size in bytes of each element of the memoryview:

Syntax

PYTHON
itemsize

Examples

Example 1
PYTHON
>>> import array, struct
>>> m = memoryview(array.array('H', [32000, 32001, 32002]))
>>> m.itemsize
2
>>> m[0]
32000
>>> struct.calcsize('H') == m.itemsize
True