On 08. 09. 21 14:40, Victor Stinner wrote:
Hi,
I converted Py_TYPE() and Py_SIZE() macros to static inline functions in the future Python 3.11. It's a backward incompatible change. For example, "Py_TYPE(obj) = type;" must be replaced with "Py_SET_TYPE(obj, type);".
Why is this needed?
On Wed, Sep 8, 2021 at 2:10 PM Marc-Andre Lemburg mal@egenix.com wrote:
I believe that such breaking changes need to follow the standard PEP 387 procedure.
While your pythoncapi_compat project is nice, I don't think C extension writers will appreciate breaking changes in new releases without the two minor release announcement and warning phase.
This is especially important with the new shorter release cycle.
Emitting compiler warnings was discussed multiple times, but so far, nobody manages to write a macro which only emits a warning if it's used as an l-value "Py_TYPE(...) = ...".
So, since the steps from PEP 387 can't be followed, this should get an exception from the SC.
Py_REFCNT() macro was already converted to a static inline function in Python 3.10. This change went fine. It only broke like 1 or 2 projects. > By the way, pip hides all compiler output and most developers ignore compiler warnings.
If that's an issue, the instructions in PEP 387 are not adequate and the PEP should be amended.