Skip to content

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

Closed
@vstinner

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions