Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb417dc commit 0c80465Copy full SHA for 0c80465
1 file changed
Doc/library/stdtypes.rst
@@ -2283,11 +2283,18 @@ simple bytes or complex data structures.
2283
Notice how the size of the memoryview object can not be changed.
2284
2285
2286
- :class:`memoryview` has one method:
+ :class:`memoryview` has two methods:
2287
2288
.. method:: tobytes()
2289
2290
- Convert the data in the buffer to a bytestring and return it.
+ Return the data in the buffer as a bytestring.
2291
+
2292
+ .. method:: tolist()
2293
2294
+ Return the data in the buffer as a list of integers. ::
2295
2296
+ >>> memoryview(b'abc').tolist()
2297
+ [97, 98, 99]
2298
2299
There are also several readonly attributes available:
2300
0 commit comments