Skip to content

Python 3.15 limited API extensions #226

Description

@ngoldbaum

Python 3.15 will (hopefully) include a new ABI that allows building limited API extensions for both the GIL-enabled and free-threaded build. The new ABI will abstract over differences between the GIL-enabled and free-threaded ABI by making PyObject opaque.

See PEP 803 and PEP 809 for more details. There is currently experimental support in CPython for building PEP 803 stable ABI extensions via the private _Py_OPAQUE_PYOBJECT macro. I want to enable real-world end-to-end testing for the new stable ABI to allow the Python steering council to make informed and confident decisions.

The module initialization code will likely need to be migrated to use PEP 793 APIs on Python 3.15 and newer. There also might need to be some work in CFFI internals to avoid exposing structs that extend PyObject to the implementation of extensions outside of CFFI internals.

See numpy/numpy#30704 and cython/cython#7399 for more information about this in other projects with widely used C APIs that are attempting to add support.

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

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions