Closed
Description
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
- gh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() #107212
- gh-107211: No longer export internal functions (1) #107213
- gh-107211: No longer export internal functions (2) #107214
- gh-107211: No longer export internal functions (3) #107215
- gh-107211: No longer export internal functions (4) #107217
- gh-107211: No longer export internal variables #107218
- gh-107211: Fix select extension build on Solaris #108012
- gh-107211: No longer export pycore_strhex.h functions #108229
- gh-107211: No longer export PyTime internal functions #108422
- gh-107211: No longer export internal functions (5) #108423
- gh-107211: No longer export internal functions (6) #108424
- gh-107211: No longer export internal functions (7) #108425
- gh-107211: Fix test_peg_generator #108435
- gh-107211: No longer export internal _PyLong_FromUid() #109037