GeezerVison is showing github.com — gh-154757: Unschedule removal of Py_UNICODE (and Py_UNICODE_TYPE) by encukou · Pull Request #160538 · python/cpython
Conversation
encukou
commented
Oct 23, 2026
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
PEP-387 says (and did say back when these types were deprecated in 3.13):
If the expected maintenance overhead and security risk of the
deprecated behavior is small (e.g. an old function is
reimplemented in terms of a new, more general one),
it can stay indefinitely (or until the situation changes).
There's no need to remove two one-line typedefs.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
PEP-387 says (and did say back when these types were deprecated in 3.13):
> If the expected maintenance overhead and security risk of the
> deprecated behavior is small (e.g. an old function is
> reimplemented in terms of a new, more general one),
> it can stay indefinitely (or until the situation changes).
There's no need to remove these.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Py_UNICODE and Py_UNICODE_TYPE are legacy of Python 3.2 which had this annoying "narrow vs wide" build. Python 3.3 and newer now uses Py_UCS4 which is 32-bit on all platforms. I don't think that we should keep them longer. It doesn't seem to be a big deal to remove these types: #154759 (comment).
If you want wchar_t, well, use wchar_t. Don't use Py_UNICODE or Py_UNICODE_TYPE.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Should we change the PEP, then?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
AA-Turner
Awaiting requested review from AA-Turner
AA-Turner is a code owner
ZeroIntensity
Awaiting requested review from ZeroIntensity
ZeroIntensity is a code owner
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.