Skip to content

add DowncastIntoError::into_inner#3829

Merged
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:downcast-into-error
Feb 12, 2024
Merged

add DowncastIntoError::into_inner#3829
davidhewitt merged 1 commit intoPyO3:mainfrom
davidhewitt:downcast-into-error

Conversation

@davidhewitt
Copy link
Member

This PR adds DowncastIntoError::into_inner, as a way to get the Bound value back if the downcast fails.

The name into_inner was chosen to match std, which has several examples of this e.g. std::sync::PosionError, std::io::WriterPanicked.

Should solve the case in #3820 (comment)

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Feb 12, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2024

CodSpeed Performance Report

Merging #3829 will improve performances by 12.82%

Comparing davidhewitt:downcast-into-error (aec8d5b) with main (1279467)

Summary

⚡ 1 improvements
✅ 78 untouched benchmarks

Benchmarks breakdown

Benchmark main davidhewitt:downcast-into-error Change
not_a_list_via_downcast 244.4 ns 216.7 ns +12.82%

@davidhewitt
Copy link
Member Author

🙏 thanks for the quick approval!

@davidhewitt davidhewitt added this pull request to the merge queue Feb 12, 2024
Merged via the queue into PyO3:main with commit 94b7d7e Feb 12, 2024
@davidhewitt davidhewitt deleted the downcast-into-error branch February 12, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI-skip-changelog Skip checking changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants