bpo-34838: Perform a more easily branch-predictable type check#9659
Merged
serhiy-storchaka merged 1 commit intoJan 12, 2019
python:masterpython/cpython:masterfrom
ammaraskar:argument_clinic_subtypeammaraskar/cpython:argument_clinic_subtypeCopy head branch name to clipboard
Merged
bpo-34838: Perform a more easily branch-predictable type check#9659serhiy-storchaka merged 1 commit intopython:masterpython/cpython:masterfrom ammaraskar:argument_clinic_subtypeammaraskar/cpython:argument_clinic_subtypeCopy head branch name to clipboard
serhiy-storchaka merged 1 commit into
python:masterpython/cpython:masterfrom
ammaraskar:argument_clinic_subtypeammaraskar/cpython:argument_clinic_subtypeCopy head branch name to clipboard
Conversation
MojoVampire
reviewed
Oct 3, 2018
Contributor
There was a problem hiding this comment.
Why only tuple and dict? Same fast path would apply to all types with fast subclass flags from object.h (
Line 660 in e42b705
Contributor
There was a problem hiding this comment.
Admittedly, most things that accept int should probably accept anything convertable to int via __index__ even if it's not a direct subclass, but otherwise it seems like all the others should have the optimization available.
rhettinger
approved these changes
Dec 23, 2018
0648f10 to
51b6c3f
Compare
Argument clinic now generates fast inline code for positional parsing, so the manually implemented type check in math.dist can be removed.
51b6c3f to
bec2ace
Compare
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.
More details available on the bpo page.
https://bugs.python.org/issue34838