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
0f46ffdb
Commit
0f46ffdb
authored
Aug 26, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the old buffer object doesn't exist in Python 3 #6659
parent
f3b33221
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
Doc/c-api/buffer.rst
Doc/c-api/buffer.rst
+15
-5
No files found.
Doc/c-api/buffer.rst
View file @
0f46ffdb
...
...
@@ -10,7 +10,6 @@ Buffer Objects
.. index::
object: buffer
single: buffer interface
Python objects implemented in C can export a "buffer interface." These
...
...
@@ -297,14 +296,25 @@ Buffer related functions
length. Return 0 on success and -1 (with raising an error) on error.
.. index::
object: memoryview
MemoryView objects
==================
A memoryview object is an extended buffer object that could replace the buffer
object (but doesn't have to as that could be kept as a simple 1-d memoryview
object). It, unlike :ctype:`Py_buffer`, is a Python object (exposed as
:class:`memoryview` in :mod:`builtins`), so it can be used with Python code.
A memoryview object exposes the C level buffer interface to Python.
.. cfunction:: PyObject* PyMemoryView_FromObject(PyObject *obj)
Return a memoryview object from an object that defines the buffer interface.
.. cfunction:: PyObject * PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char order)
Return a memoryview object to a contiguous chunk of memory (in either
'C' or 'F'ortran order) from an object that defines the buffer
interface. If memory is contiguous, the memoryview object points to the
original memory. Otherwise copy is made and the memoryview points to a
new bytes object.
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