Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6db43fd

Browse files
committed
Merged revisions 85075 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r85075 | antoine.pitrou | 2010-09-28 23:52:30 +0200 (mar., 28 sept. 2010) | 3 lines Discourage use of the old buffer API funcs ........
1 parent 1ec68b1 commit 6db43fd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

Doc/c-api/objbuffer.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
.. highlightlang:: c
22

3-
.. _abstract-buffer:
3+
Old buffer API
4+
--------------
5+
6+
.. deprecated:: 3.0
7+
8+
These functions were part of the "old buffer protocol" API in Python 2.
9+
In Python 3, these functions are still exposed for ease of porting code.
10+
They act as a compatibility wrapper around the :ref:`new buffer API
11+
<bufferobjects>`, but they don't give you control over the lifetime of
12+
the resources acquired when a buffer is exported.
13+
14+
Therefore, it is recommended that you call :cfunc:`PyObject_GetBuffer`
15+
(or the ``y*`` or ``w*`` :ref:`format codes <arg-parsing>` with the
16+
:cfunc:`PyArg_ParseTuple` family of functions) to get a buffer view over
17+
an object, and :cfunc:`PyBuffer_Release` when the buffer view can be released.
18+
419

520
Buffer Protocol
621
===============

0 commit comments

Comments
 (0)