Skip to content

Deprecate PyASCIIObject/PyUnicodeObject #131510

Description

@encukou

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions