PyDocs

Nav

Python Runtime Services

memoryview.nbytes

builtins

attribute of memoryview · Added in 3.3
The amount of space in bytes that the array would use in
a contiguous representation.
1 Example
>>> import array
>>> a = array.array('i', [1,2,3,4,5])
>>> m = memoryview(a)
>>> len(m)
5
>>> m.nbytes
20
>>> y = m[::2]
>>> len(y)
3
>>> y.nbytes
12
>>> len(y.tobytes())
12
from the Python docs
See Also
No see-alsos for builtins/memoryview.nbytes
0 Notes
No notes for memoryview.nbytes