Use Py_IS_TYPE on abi3 & python 3.15+#5977
Open
bschoenmaeckers wants to merge 1 commit intoPyO3:mainfrom
Open
Conversation
bb38a69 to
eb1faa7
Compare
eb1faa7 to
2cecf6d
Compare
Tpt
approved these changes
Apr 17, 2026
ngoldbaum
approved these changes
Apr 17, 2026
Contributor
ngoldbaum
left a comment
There was a problem hiding this comment.
This also follows how CPython spells these check macros.
I seriously doubt adding one extra function call that can be inlined matters for non-limited API builds, but I'll defer to @davidhewitt to give this a look and hit the merge button.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid raw pointer comparison on ABI3 when
Py_IS_TYPEis available.xref RustPython/RustPython#7562