Specialize self conversion for descriptor slots#5930
Draft
MatthieuDartiailh wants to merge 1 commit intoPyO3:mainfrom
Draft
Specialize self conversion for descriptor slots#5930MatthieuDartiailh wants to merge 1 commit intoPyO3:mainfrom
MatthieuDartiailh wants to merge 1 commit intoPyO3:mainfrom
Conversation
…es ensure a bad type cannot be passed from Python
Member
|
Thanks, see also #4026 which is a similar (draft) PR I started a long time ago and never quite managed to finish off. Generally this optimization applies to more than just descriptors; would you be willing to extend this optimization to the rest of the methods? (That PR has some discussion.) |
Contributor
Author
|
I can try to give your PR a look, yes. But I may not be very fast in doing so. |
Member
|
No worries I haven't made progress on that PR for 2 years, all help is welcome at whatever pace 😂 |
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.
For descriptor slots, CPython does ensure a bad type cannot be passed from Python and the type check can hence be bypassed. This allow to make PyO3 written descriptor closer in performance to equivalent descriptors written in C or C++