]> granicus.if.org Git - python/commitdiff
endow memoryview.tolist() with docs
authorBenjamin Peterson <benjamin@python.org>
Wed, 10 Sep 2008 21:31:58 +0000 (21:31 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 10 Sep 2008 21:31:58 +0000 (21:31 +0000)
Doc/library/stdtypes.rst

index a03346a392bd950d68b32d53af86ebfdf5ab89b8..7f295a1fb0cf42d4de57f7310111ca8f8a8ca8ed 100644 (file)
@@ -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: