FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-47164: Add _PyASCIIObject_CAST() macro by vstinner · Pull Request #32191 · python/cpython · GitHub

Repository navigation

bpo-47164: Add _PyASCIIObject_CAST() macro - #32191

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:unicode_cast
Mar 31, 2022
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:unicode_cast

Conversation

vstinner commented Mar 30, 2022 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject*
and PyUnicodeObject*: _PyASCIIObject_CAST(),
_PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using
these new macros make the code more readable and check their argument
with: assert(PyUnicode_Check(op)).

Remove redundant assert(PyUnicode_Check(op)) in macros using directly
or indirectly these new CAST macros.

Replacing existing casts with these macros.

https://bugs.python.org/issue47164

Add macros to cast objects to PyASCIIObject*, PyCompactUnicodeObject*
and PyUnicodeObject*: _PyASCIIObject_CAST(),
_PyCompactUnicodeObject_CAST() and _PyUnicodeObject_CAST(). Using
these new macros make the code more readable and check their argument
with: assert(PyUnicode_Check(op)).

Remove redundant assert(PyUnicode_Check(op)) in macros using directly
or indirectly these new CAST macros.

Replacing existing casts with these macros.

methane commented Mar 31, 2022

Copy link
Copy Markdown
Member

It looks good to me, but I don't understand why MSVC can't compile it....

Copy link
Copy Markdown
Member Author

It looks good to me, but I don't understand why MSVC can't compile it....

Ah, it was a typo on a macro only used on Windows. It should be fixed now.

vstinner merged commit c14d7e4 into python:main Mar 31, 2022
vstinner deleted the unicode_cast branch March 31, 2022 07:59

Copy link
Copy Markdown
Member Author

Merged. Thanks for the review @methane.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL