Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4785916d
Commit
4785916d
authored
Sep 10, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release() is probably not the most important method
parent
fe7b4053
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
Doc/library/stdtypes.rst
Doc/library/stdtypes.rst
+18
-18
No files found.
Doc/library/stdtypes.rst
View file @
4785916d
...
...
@@ -2313,6 +2313,24 @@ is generally interpreted as simple bytes.
:class:`memoryview` has several methods:
.. method:: tobytes()
Return the data in the buffer as a bytestring. This is equivalent to
calling the :class:`bytes` constructor on the memoryview. ::
>>> m = memoryview(b"abc")
>>> m.tobytes()
b'abc'
>>> bytes(m)
b'abc'
.. method:: tolist()
Return the data in the buffer as a list of integers. ::
>>> memoryview(b'abc').tolist()
[97, 98, 99]
.. method:: release()
Release the underlying buffer exposed by the memoryview object. Many
...
...
@@ -2346,24 +2364,6 @@ is generally interpreted as simple bytes.
.. versionadded:: 3.2
.. method:: tobytes()
Return the data in the buffer as a bytestring. This is equivalent to
calling the :class:`bytes` constructor on the memoryview. ::
>>> m = memoryview(b"abc")
>>> m.tobytes()
b'abc'
>>> bytes(m)
b'abc'
.. 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:
.. attribute:: format
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment