-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-105373: Remove the PyObject_SetAttr(NULL) deprecation #105374
Conversation
Remove the deprecation on the following functions: * PyObject_SetAttr(obj, attr_name, NULL) * PyObject_SetAttrString(obj, attr_name, NULL) * PySequence_SetItem(obj, i, NULL) * PySequence_SetSlice(obj, i1, i2, NULL) Deprecation added by commit ed82604.
Deprecation added by issue #69887. cc @serhiy-storchaka @vadmium I would prefer that either we fully removed these deprecations, or to really deprecate them: emit DeprecationWarning at runtime. |
What is changed since it was discussed 8 years ago? |
I would like to clarify what is really deprecated or not in Python 3.13. I don't see the value of a mention of a deprecation in the documentation without using IMO passing NULL is just fine, it's not going to change, so there is no need to deprecate it. In 2015, you wrote:
So well, I propose to actually not deprecate it :-D |
The Gmane link no longer work, the working links to the discussion (it was split on several threads) are The problems with the current behavior:
Changing the current behavior is a long process. M.-A. Lemburg specified the required procedure. It is interesting, that if we started it in 3.6, it would already be finished. |
I reported this error prone API as capi-workgroup/problems#47 |
Oh right. I would prefer to emit a DeprecationWarning in this case and prepare a migration plan towards "Del" functions instead. I don't think that a sentence in the documentation is enough to help users to avoid mistakes. |
I created a discussion to specify "Soft Deprecation" in PEP 387: https://discuss.python.org/t/formalize-the-concept-of-soft-deprecation-dont-schedule-removal-in-pep-387-backwards-compatibility-policy/27957 |
I close this PR in favor of issue #106572: Deprecate PyObject_SetAttr(obj, name, NULL): PyObject_DelAttr(obj, name) must be used instead. |
Remove the deprecation on the following functions:
Deprecation added by commit ed82604.
📚 Documentation preview 📚: https://cpython-previews--105374.org.readthedocs.build/