Skip to content

Use Py_GetConstantBorrowed for python True & False on abi3#5956

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
bschoenmaeckers:get-constant-bool
Apr 8, 2026
Merged

Use Py_GetConstantBorrowed for python True & False on abi3#5956
davidhewitt merged 1 commit intoPyO3:mainfrom
bschoenmaeckers:get-constant-bool

Conversation

@bschoenmaeckers
Copy link
Copy Markdown
Member

So we do not depend on _Py_TrueStruct when compiling for abi3

xref RustPython/RustPython#7562

@bschoenmaeckers bschoenmaeckers changed the title Use Py_GetConstantBorrowed for python True & False on abi3 Use Py_GetConstantBorrowed for python True & False on abi3 Apr 7, 2026
@bschoenmaeckers bschoenmaeckers force-pushed the get-constant-bool branch 2 times, most recently from 7759b2b to 7bcd209 Compare April 7, 2026 19:14
Copy link
Copy Markdown
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks 👍

I briefly considered whether we should do this on the version-specific API too, I think it's fine to keep accessing these symbols for now while they're in the CPython headers. (Note we define them static mut without pub so don't make the symbols accessible to users.)

@davidhewitt davidhewitt added this pull request to the merge queue Apr 8, 2026
Merged via the queue into PyO3:main with commit e662975 Apr 8, 2026
46 checks passed
@bschoenmaeckers bschoenmaeckers deleted the get-constant-bool branch April 10, 2026 12:38
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.

2 participants