GeezerVison is showing github.com — Keep deprecated functions in Python 3.13: remove this deprecation · Issue #105373 · python/cpython
Keep deprecated functions in Python 3.13: remove this deprecation #105373DescriptionThere 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:
#define PyObject_DelAttr(O, A) PyObject_SetAttr((O), (A), NULL)
Linked PRs
Reacted by Raymond Hettinger and Maurice Activityhugovk 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. Reacted by Victor Stinner 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. arhadthedev commented on Jun 11, 2023
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.
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. vstinner commented on Jul 10, 2023
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". 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. j4hangir commented on Aug 23, 2025 Would be nice to have .warn() kept. vstinner commented on Sep 1, 2025
Would be nice to have .warn() kept.
The removal of logging.Logger.warn() is not planned. j4hangir commented on Sep 1, 2025
Would be nice to have .warn() kept.
The removal of logging.Logger.warn() is not planned.
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.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|