GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@encukou encukou commented Oct 23, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • Issue: 26 C APIs scheduled for removal in 3.16 are still present #154757

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@encukou
pythongh-154757: Unschedule removal of Py_UNICODE (and Py_UNICODE_TYPE)
0e59aed
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.
@encukou
encukou requested a review from vstinner October 23, 2026 22:52
@encukou
encukou requested review from AA-Turner and ZeroIntensity as code owners October 23, 2026 22:52
@bedevere-app bedevere-app Bot added awaiting core review type-feature A feature request or enhancement labels Oct 23, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Oct 23, 2026
26 C APIs scheduled for removal in 3.16 are still present #154757
Open
3 tasks
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Oct 23, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Oct 23, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Oct 23, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 23, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35367863 | 📁 Comparing 0e59aed against main (5ca490b)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

  • c-api/unicode.html
  • deprecations/c-api-pending-removal-in-3.16.html
  • whatsnew/3.12.html
  • whatsnew/3.13.html
  • whatsnew/3.14.html
  • whatsnew/3.16.html
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner reviewed Oct 24, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

All reactions
@encukou

encukou commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Should we change the PEP, then?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Nov 4, 2026
gh-154757: Remove the deprecated Py_UNICODE type #154759
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
@ZeroIntensity 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

Labels

awaiting core review docs Documentation in the Doc dir skip news type-feature A feature request or enhancement

Projects

Docs PRs
Status: Todo

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.

2 participants

@encukou @vstinner
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.