This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Buffer support in the stable ABI
Type: behavior Stage: resolved
Components: Build Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: methane, petr.viktorin, tarun.johar
Priority: normal Keywords:

Created on 2021-07-12 15:05 by tarun.johar, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg397319 - (view) Author: Tarun Johar (tarun.johar) Date: 2021-07-12 15:05
PEP 384 and PEP 652 define a stable ABI to be used with Python 3.2 and later.  On Windows, symbols for the stable ABI are exported from the python3.dll shared library.

The following functions are present in Python 3.9 but have been removed from Python 3.10b3:

PyObject_AsCharBuffer()
PyObject_AsReadBuffer()
PyObject_AsWriteBuffer()
PyObject_CheckReadBuffer()

The justification for the removal of these functions was discussed in this issue:

https://bugs.python.org/issue41103

Without these functions, an extension cannot utilize the stable ABI to access the buffer memory of data structures.  The buffer protocol is suggested as an alternative, but the buffer functions PyObject_GetBuffer() and PyBuffer_Release() are not present in the stable ABI.

While these two functions may be added to the stable ABI, removal of the four functions above makes Python 3.10 incompatible with previous versions.  It is requested that the four functions be reinstated and maintained as described in PEP 652.
msg404601 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2021-10-21 13:30
That removal was reverted. Thanks for the report!

They are still deprecated, which means they may be removed from future API (and only remain in the stable ABI).
But I hope that's only considered when the new buffer protocol is available in the stable ABI.
History
Date User Action Args
2022-04-11 14:59:47adminsetgithub: 88775
2021-10-21 13:30:09petr.viktorinsetstatus: open -> closed

nosy: + petr.viktorin
messages: + msg404601

resolution: fixed
stage: resolved
2021-07-29 07:18:20methanesetnosy: + methane
2021-07-12 15:05:02tarun.joharcreate