gh-106320: Remove private _PyLong_IsCompact() function#108742
gh-106320: Remove private _PyLong_IsCompact() function#108742vstinner wants to merge 1 commit intopython:mainfrom
Conversation
|
With this change, PyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue() become regular opaque function calls. They are no longer implemented as static inline functions. That's needed to be able remove the 2 associated static inline functions from the public C API.
When I tried to use the See: |
Move the private _PyLong_IsCompact() and _PyLong_CompactValue() functions to the internal C API (pycore_long.h). Public PyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue() functions can be used instead. Remove "const" qualifier from PyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue() parameter type.
1969769 to
c6be6f8
Compare
|
@gvanrossum @markshannon: Are the private _PyLong_IsCompact() and _PyLong_CompactValue() functions exposed by I don't know the impact on performance. I'm more in favor of hiding implementation details. If these functions are moved to the internal C API, are you ok to also make this change in Python 3.12?
I don't have a strong opinion on that, I'm also fine with keeping const if you prefer :-) It's just that in the past, I tried to use |
|
Please don’t touch these. They are meant to be exported. |
|
Also it’s too late for 3.12. |
Ok, let's keep them. |
Move the private _PyLong_IsCompact() and _PyLong_CompactValue() functions to the internal C API (pycore_long.h). Public PyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue() functions can be used instead.
Remove "const" qualifier from PyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue() parameter type.
📚 Documentation preview 📚: https://cpython-previews--108742.org.readthedocs.build/