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-89653: PEP 670: Convert unicodeobject.h macros to functions#91705
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
@erlend-aasland: Ok, here is a shorter PR. I left the PyUnicode_KIND() macro unchanged since converting it to a static inline function introduces new compiler warning if the return type is |
Convert unicodeobject.h macros to static inline functions:* PyUnicode_CHECK_INTERNED()* PyUnicode_DATA(), _PyUnicode_COMPACT_DATA(), _PyUnicode_NONCOMPACT_DATA()* PyUnicode_GET_LENGTH()* PyUnicode_IS_ASCII()* PyUnicode_IS_COMPACT()* PyUnicode_IS_COMPACT_ASCII()* PyUnicode_IS_READY()Reorder functions to declare functions before their first usage.Static inline functions are wrapped into macros which casts"PyObject*" with _PyObject_CAST() to prevent introducing new compilerwarnings when passing "const PyObject*".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good! I left some small nitpick comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Convert unicodeobject.h macros to static inline functions:
_PyUnicode_NONCOMPACT_DATA()
Reorder functions to declare functions before their first usage.
Static inline functions are wrapped into macros which casts
"PyObject*" with _PyObject_CAST() to prevent introducing new compiler
warnings when passing "const PyObject*".