diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-09-10 21:31:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-09-10 21:31:58 (GMT) |
commit | 0c8046511945149abc822e2a7d7bdba682bd9ed3 (patch) | |
tree | af6fd9e090a206ab3b7af4e010c71f99aa4e47ae /Doc | |
parent | bb417dcc49def0582d50d94eddcd6172214e61d5 (diff) | |
download | cpython-0c8046511945149abc822e2a7d7bdba682bd9ed3.zip cpython-0c8046511945149abc822e2a7d7bdba682bd9ed3.tar.gz cpython-0c8046511945149abc822e2a7d7bdba682bd9ed3.tar.bz2 |
endow memoryview.tolist() with docs
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/stdtypes.rst | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a03346a..7f295a1 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2283,11 +2283,18 @@ simple bytes or complex data structures. Notice how the size of the memoryview object can not be changed. - :class:`memoryview` has one method: + :class:`memoryview` has two methods: .. method:: tobytes() - Convert the data in the buffer to a bytestring and return it. + Return the data in the buffer as a bytestring. + + .. method:: tolist() + + Return the data in the buffer as a list of integers. :: + + >>> memoryview(b'abc').tolist() + [97, 98, 99] There are also several readonly attributes available: |