There are multiple Python functions marked as "deprecated", usually only in the documentation, or sometimes in comments, whereas the feature is there for a long time and there is no need to remove them, or the rationale changed.
For example, the array.array('u') format was deprecated since it used the Py_UNICODE C type (which is deprecated), but the code was updated to use the wchar_t C type which is fine and not depreated.
Another example is passing NULL as value to PyObject_SetAttr(obj, name, value) to delete an object attribute is deprecated... but this feature exists since the birth of Python. I don't think that it's really useful to deprecate this behavior: it's fine to keep it. The PyObject_DelAttr() function is just implemented as a macro passing NULL:
#definePyObject_DelAttr(O, A) PyObject_SetAttr((O), (A), NULL)
I wanted to propose the keep the deprecated logging.Logger.warn() method (remove its deprecation)... but instead I proposed to remove it :-) see issue #105376.
For example, the array.array('u') format was deprecated since it used the Py_UNICODE C type (which is deprecated), but the code was updated to use the wchar_t C type which is fine and not depreated.
There are few situations where platform- or compiler-dependent wchar_t arrays are useful.
Many users use array('u') as a mutable Unicode buffer, and array('w') is recommended for that use.
Another example is passing NULL as value to PyObject_SetAttr(obj, name, value) to delete an object attribute is deprecated... but this feature exists since the birth of Python. I don't think that it's really useful to deprecate this behavior: it's fine to keep it. (...)
I created issue #106572: "Deprecate PyObject_SetAttr(obj, name, NULL): PyObject_DelAttr(obj, name) must be used instead".
Well, I did the cleanup that I wanted to do about pending incompatible changes. I just proposed a new PR #106675 to elaborate the "Pending Removal" documentation.
I propose to open new issues if we want to adjust other pending incompatible changes: unschedule them, schedule them, or schedule them earlier.
Activity
hugovk commented on Jun 6, 2023
See also #80480 which links to a merged PR to add array.array('w') and with an open PR to deprecate array.array('u'), cc @methane.
pythongh-105373: PyObject_SetAttr() to delete an attr is no longer de…
pythongh-105373: PyObject_SetAttr(NULL) is no longer deprecated
pythongh-105373: PyObject_SetAttr(NULL) is no longer deprecated
vstinner commented on Jun 6, 2023
I wanted to propose the keep the deprecated logging.Logger.warn() method (remove its deprecation)... but instead I proposed to remove it :-) see issue #105376.
pythongh-105373: Remove PyArg_Parse() deprecation
pythongh-105373: Fix decimal documentation formatting
gh-105373: Fix decimal documentation formatting (#105395)
pythongh-105373: Remove PyArg_Parse() deprecation
arhadthedev commented on Jun 11, 2023
methane commented on Jun 12, 2023
See #80480 (comment)
There are few situations where platform- or compiler-dependent wchar_t arrays are useful.
Many users use array('u') as a mutable Unicode buffer, and array('w') is recommended for that use.
gh-105373: Remove PyArg_Parse() deprecation (#105394)
pythongh-105373: Doc lists pending C API removals
gh-105373: Doc lists pending C API removals (#106537)
5 remaining items
pythongh-105373: Doc lists pending removals
gh-105373: Doc lists pending removals (#106540)
pythongh-105373: Deprecate PyObject_SelAttr(v, name, NULL)
pythongh-105373: Deprecate PyObject_SelAttr(v, name, NULL)
pythongh-105373: Deprecate PyObject_SetAttr(v, name, NULL)
vstinner commented on Jul 10, 2023
I created issue #106572: "Deprecate PyObject_SetAttr(obj, name, NULL): PyObject_DelAttr(obj, name) must be used instead".
pythongh-105373: Eloborate Pending Removal in What's New in Python 3.13
pythongh-105373: Elaborate Pending Removal in What's New in Python 3.13
vstinner commented on Jul 12, 2023
Well, I did the cleanup that I wanted to do about pending incompatible changes. I just proposed a new PR #106675 to elaborate the "Pending Removal" documentation.
I propose to open new issues if we want to adjust other pending incompatible changes: unschedule them, schedule them, or schedule them earlier.
gh-105373: Elaborate Pending Removal in What's New in Python 3.13 (#1…
j4hangir commented on Aug 23, 2025
Would be nice to have .warn() kept.
vstinner commented on Sep 1, 2025
The removal of logging.Logger.warn() is not planned.
j4hangir commented on Sep 1, 2025
I assumed since it's deprecated it'll be eventually removed, in that case I'd agree that the deprecation is also not needed on it.
vstinner commented on Sep 1, 2025
Since this issue is closed, I suggest you opening a new issue if you have a strong opinion on warn() deprecation.