Skip to content

C API: No longer export internal C API functions #107211

Description

@vstinner

Many internal C API functions are exported with PyAPI_FUNC() and internal variables are exported with PyAPI_DATA(), whereas these APIs should not be used outside Python internals.

I propose to replace PyAPI_FUNC() and PyAPI_DATA() with extern on symbols which are not used by stdlib shared extensions.

The exception should be to export, not the default. For example, the _PyObject_DebugMallocStats() function is exported by the 3rd party guppy3 project.

See also issue #106320: C API: Remove private C API functions (move them to the internal C API).

Linked PRs

Activity

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions