ID EN
Built-in Types

tolist

Python 3.11

Return the data in the buffer as a list of elements.

Syntax

PYTHON
tolist()

Examples

Example 1
PYTHON
>>> memoryview(b'abc').tolist()
[97, 98, 99]
>>> import array
>>> a = array.array('d', [1.1, 2.2, 3.3])
>>> m = memoryview(a)
>>> m.tolist()
[1.1, 2.2, 3.3]

See Also

tolist() struct