bpo-40170: Convert PyIter_Check macro to a function by erlend-aasland · Pull Request #24548 · python/cpython · GitHub
Skip to content

bpo-40170: Convert PyIter_Check macro to a function - #24548

Merged
vstinner merged 6 commits into
python:masterfrom
erlend-aasland:bpo-40170/PyIter_Check
Feb 16, 2021
Merged

vstinner merged 6 commits into
python:masterfrom
erlend-aasland:bpo-40170/PyIter_Check

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

The macro accessed the PyTypeObject.tp_iternext member directly.
"Swap" macro variant with the function in order to hide implementation details.
(A function already existed, but it was not exposed.)

https://bugs.python.org/issue40170

@erlend-aasland

Copy link
Copy Markdown
Contributor Author

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For macOS which doesn't use LTO compiler optimization, we added private static inline functions of some "Check" functions. But I don't think that it's worth it here (I don't think that the function is commonly called in "hot code").

Comment thread Objects/abstract.c Outdated
Comment thread Include/cpython/abstract.h Outdated
Comment thread Doc/c-api/iter.rst
Comment thread Misc/NEWS.d/next/Core and Builtins/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst Outdated
Erlend Egeberg Aasland and others added 4 commits February 16, 2021 13:10
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

CI is done; PTAL, @vstinner.

@vstinner
vstinner merged commit cc54001 into python:master Feb 16, 2021
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks.

@erlend-aasland
erlend-aasland deleted the bpo-40170/PyIter_Check branch February 16, 2021 15:14
@bedevere-bot

Copy link
Copy Markdown

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Feb 17, 2021
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants