-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for PEP 387 exception: Py_SET_TYPE #79
Comments
See also https://www.python.org/dev/peps/pep-0670/ which is not directly related. |
PEP 670 was just updated to explicitly say it's not related. |
Thanks for the request @encukou and thanks for raising this to our attention. After deliberating over this, the Steering Council has agreed that the aforementioned changes to Being said that, we also want to add the following:
|
Please, feel free to reopen this issue if there is something missing or anything you would like to further discuss. |
I do. Apparently there is a lot of other macros that are also being converted now. Does this decision apply to all of these? And for any future ones? Also:
There is currently no deprecation warning for this change. What do you mean by "the deprecation notice"? (The closest I can find is a silent documentation change between 3.9 and 3.10, and a What's New entry for 3.11.) |
(I don't have the permission to reopen the issue.) |
(Reopened) |
This decision only applies to |
We mean that in general (not for this change as we have made an exception per our previous argument), there should be a deprecation notice in some way or form (in these cases must be in the docs/what's new as there is no way to make the preprocessor warn only when we need it). We just wanted to reiterate that in general, we still want two releases with some deprecation notice for any deprecation, unless exempt.
For this case, just the What's New entry for 3.11. |
Thanks for the clarifications! |
In Python 3.11.0a1, the
Py_TYPE
macro was changed to a function, meaning that it cannot be used as a r-value (i.e. assignment target). All C code of the forms:must be converted to
This is documented in What's New in Python 3.11
The
Py_SET_TYPE
function was added in Python 3.9.This change breaks existing code (though many popular projects have already been adapted in the 3.9-3.10 development window).
The change did not follow the process in PEP 387 -- Backwards Compatibility Policy, which calls for a warning for at least two releases before things break. Unfortunately, it is not feasible to only emit a warning when the macro is used as an assignment target.
The reasons for the change are given in a thread on capi-sig, specifically:
I'm not the best person to ask for this exception, as I disagree with making the change now. I believe that:
Py_TYPE
as r-value is deprecated;Py_SET_TYPE
is in all supported Python versions.I also think that PEP 387 says pretty clearly that exceptions from the policy need a Steering Council exception, but couldn't reach a friendly agreement on that :(
So, here we are: Please consider the change.
The text was updated successfully, but these errors were encountered: