Skip to content
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

Deprecate PyASCIIObject/PyUnicodeObject #131510

Open
encukou opened this issue Mar 20, 2025 · 0 comments
Open

Deprecate PyASCIIObject/PyUnicodeObject #131510

encukou opened this issue Mar 20, 2025 · 0 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API topic-unicode type-feature A feature request or enhancement

Comments

@encukou
Copy link
Member

encukou commented Mar 20, 2025

Feature or enhancement

Deprecate, and plan removal of, direct access to string internals:

  • `PyASCIIObject, PyCompactUnicodeObject, PyUnicodeObject structs
  • the PyUnicode_IS_COMPACT macro

This will allow reorganizing the structs for optimizations or new features.

One possible new feature is better support for subclasses that need additional C state. The NumPy and PyObjC projects currently do this. Both can adapt to CPython changes relatively quickly, so we can provide unstable API for their use case.

See discussion.

C API WG vote pending.

Linked PRs

@encukou encukou added topic-C-API type-feature A feature request or enhancement labels Mar 20, 2025
@picnixz picnixz added interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-unicode labels Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-C-API topic-unicode type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants