Skip to content

CPython project has the lead on the C API, other Python implementations have to follow #64

@vstinner

Description

@vstinner

Other Python implementations have to provide a compatible C API, as complete and compatible as possible. The problem is that the C API leaks many implementation details like memory layout (structures like PyTupleObject or PyDictObject), memory allocation (objects must be allocated on the heap), reference counting, etc. The C API doesn't fit well with a moving GC for example.

While some core devs tries to reach consumers of this API and developers of other Python implementations, in practice, CPython still has the lead the C API and dictates how other Python implementations must provide a C API.

Maybe the HPy project will change that, since HPy gives a great freedom on how a Python implementation supports HPy. In the meanwhile, there is a long list of C extensions accessing directly the C API.

Other option is to migrate existing C extensions to higher level API like Cython, HPy, cffi, pybind11 or anything else: no longer access the C API directly.

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