Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-106320: Remove private _PyLong_IsCompact() function#108742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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). PublicPyUnstable_Long_IsCompact() and PyUnstable_Long_CompactValue()functions can be used instead.Remove "const" qualifier from PyUnstable_Long_IsCompact() andPyUnstable_Long_CompactValue() parameter type.
1969769
toc6be6f8
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 ofhiding 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. |
Uh oh!
There was an error while loading.Please reload this page.
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/