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
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