File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
520Buffer Protocol
621===============
You can’t perform that action at this time.
0 commit comments