On 08. 06. 21 10:05, Serhiy Storchaka wrote:
07.06.21 08:41, Hai Shi пише:
There have an another question. There have many C API defined under 
PY_SSIZE_T_CLEAN, for example: _PyArg_Parse_SizeT().
Could we remove or merge them after making PY_SSIZE_T_CLEAN not mandatory?

We should support binary compatibility to some degree, so there should
be several steps:

* Make macro PyArg_Parse an alias of _PyArg_Parse_SizeT. Keep function
PyArg_Parse.

One more thing about the stable ABI: in the future, I'd like to make it more useful in languages other than C. This usually means avoiding macros. Would it make sense to expose _PyArg_Parse_SizeT as a public function, like PyArgT_Parse? (The macro redirecting PyArg_Parse to this function could of course stay, to help C users.)

* Make function PyArg_Parse always raising an exception.

This would break extensions that use the stable ABI.
(Yes, even starting to raise RuntimeError in 3.10 broke things. And yes, it's not strictly an ABI issue, but it has the same effect for users: they still need to recompile extensions to keep them working.)

* Remove function PyArg_Parse.
* [Optionally] Now we can re-add function PyArg_Parse as an alias of
_PyArg_Parse_SizeT and remove macro PyArg_Parse.
* [Optionally in 4.0 or 5.0] Remove _PyArg_Parse_SizeT.

But we can squish several last steps in 4.0 which do not need to support
binary compatibility with 3.x.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZLS2AUQDGT3NHSBM63XEPN3TEUGRAP4Z/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to