You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use _Py_EnterRecursiveCall private API in _bisectmodule.c #101903
I just noticed the _bisectmodule.c is the only internal module using the Py_EnterRecursiveCall and Py_LeaveRecursiveCall public API functions instead of the private ones with underscores. For both consistency and a tiny performance enhancement, I think it would make sense to use the private API instead.
Pitch
I have a PR ready for this, but since I have no idea of what I am doing this might be completely bogus 😉.
As noted in #101931 (comment), this requires defining _bisectmodule.c as a core module, which IMO requires a broader discussion.
We deliberately make some stdlib extension modules use the public C API. As an (unrwritten) general rule, the modules in Modules/Setup.bootstrap.in are built using the internal C API, whereas the modules in Modules/Setup.stdlib.in should preferably use the public C API.
Activity
OTheDev commentedon Feb 14, 2023
Looks like the Public API functions
cpython/Python/ceval.c
Lines 3066 to 3081 in 23751ed
are just wrappers for the private static inline functions
cpython/Include/internal/pycore_ceval.h
Lines 135 to 147 in 7644935
@gdementen - I don't see the harm in submitting a PR!
gh-101903: Remove obsolete undefs for previously removed macros Py_En…
erlend-aasland commentedon Feb 21, 2023
As noted in #101931 (comment), this requires defining
_bisectmodule.cas a core module, which IMO requires a broader discussion.We deliberately make some stdlib extension modules use the public C API. As an (unrwritten) general rule, the modules in
Modules/Setup.bootstrap.inare built using the internal C API, whereas the modules inModules/Setup.stdlib.inshould preferably use the public C API.Suggesting to close this issue as not-planned.
erlend-aasland commentedon Feb 21, 2023
See also Eric's comments from similar API issues: #31376 (comment) and #31376 (comment)
OTheDev commentedon Feb 21, 2023
Thanks @erlend-aasland
Merge branch 'main' into lockfreecp
pythongh-101903: Remove obsolete undefs for previously removed macros…
pythongh-101903: Remove obsolete undefs for previously removed macros…
pythongh-101903: Remove obsolete undefs for previously removed macros…