Skip to content

Deprecate PyASCIIObject/PyUnicodeObject #131510

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

Closed
encukou opened this issue Mar 20, 2025 · 1 comment
Closed

Deprecate PyASCIIObject/PyUnicodeObject #131510

encukou opened this issue Mar 20, 2025 · 1 comment
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
@encukou
Copy link
Member Author

encukou commented Apr 28, 2025

The discussion identified a use case to address first. I'll close this for now.

@encukou encukou closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 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