-
Couldn't load subscription status.
- Fork 2.2k
Expand float and complex strict mode to allow ints and ints/float. Updates type hints to match better with typing.SupportsIndex
#5879
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
InvincibleRMC
wants to merge
32
commits into
pybind:master
Choose a base branch
from
InvincibleRMC:expand-float-strict
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
515a3ab
init
InvincibleRMC aa2693f
Add constexpr to is_floating_point check
gentlegiantJGC 7948b27
Allow noconvert float to accept int
gentlegiantJGC 47746af
Update noconvert documentation
gentlegiantJGC 507d31c
Allow noconvert complex to accept int and float
gentlegiantJGC f4115fe
Merge remote-tracking branch 'collab/fix-pep-484' into expand-float-s…
InvincibleRMC 4ea8bcb
Add complex strict test
InvincibleRMC 81e49f6
style: pre-commit fixes
pre-commit-ci[bot] 0b94f21
Update unit tests so int, becomes double.
InvincibleRMC e9bf4e5
style: pre-commit fixes
pre-commit-ci[bot] 21f8447
remove if (constexpr)
InvincibleRMC 5806318
fix spelling error
InvincibleRMC a0fb6dc
bump order in #else
InvincibleRMC 2692820
Switch order in c++11 only section
InvincibleRMC b12f5a8
ci: trigger build
InvincibleRMC 2187a65
ci: trigger build
InvincibleRMC d42c8e8
Allow casting from float to int
gentlegiantJGC 16bdff3
tests for py::float into int
InvincibleRMC 358266f
Update complex_cast tests
InvincibleRMC dadbf05
Add SupportsIndex to int and float
InvincibleRMC 248b12e
style: pre-commit fixes
pre-commit-ci[bot] 2163f50
fix assert
InvincibleRMC c13f21e
Update docs to mention other conversions
InvincibleRMC f4ed7b7
fix pypy __index__ problems
InvincibleRMC fc815ec
style: pre-commit fixes
pre-commit-ci[bot] 388366f
extract out PyLong_AsLong __index__ deprecation
InvincibleRMC a956052
style: pre-commit fixes
pre-commit-ci[bot] 962c9fa
Add back env.deprecated_call
InvincibleRMC 7b1bc72
remove note
InvincibleRMC edbcbf2
remove untrue comment
InvincibleRMC a3a4a5e
fix noconvert_args
InvincibleRMC d5dab14
resolve error
InvincibleRMC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Can you explain why you are doing this?
Doesn't
PyComplex_AsCComplexhandle that?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.
Without this I was getting failures on old pypy versions see https://github.com/pybind/pybind11/actions/runs/18790097220/job/53618039827.
See this issue for more info pypy/pypy#3383
So I copied the logic from the numeric caster. Ref
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.
Okay I think I understand. Can you add a comment in the code explaining it?