[issue41103] Removing old buffer support

Petr Viktorin report at bugs.python.org
Thu Aug 5 04:33:02 EDT 2021


Petr Viktorin <encukou at gmail.com> added the comment:

These should be removed from the *limited API*, but stay for the stable ABI.
(PEP 652 mentions this can happen but doesn't give details, which will be a bit tricky. These are good candidates for figuring out the process.)

I assigned this to myself; I'll try to get to it for 3.11.


> What is the benefit of removing this? Is copy pasting the compatibility layer to (possibly many) different projects worth the "cleanup"?

Yes. PyObject_AsReadBuffer is dangerous *in general*, but in certain specific cases where you're relying on CPython implementations details it can work. For example, borrowing a buffer from a *string* or *array* will work on CPython, and I don't see that changing any time soon. So, using PyObject_AsReadBuffer is still tech debt, but for some projects that's OK.

All this should be documented in the release notes, though, so the projects know what they're doing. (And the release notes should be written *with the change*, not later, so projects testing early can read them.)

----------
assignee:  -> petr.viktorin
nosy: +petr.viktorin
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41103>
_______________________________________


More information about the Python-bugs-list mailing list