Skip to content

[mypyc] feat: implement try_getting_literal in in rtuple helper [1/1]#20032

Draft
BobTheBuidler wants to merge 5 commits into
python:masterfrom
BobTheBuidler:patch-17
Draft

[mypyc] feat: implement try_getting_literal in in rtuple helper [1/1]#20032
BobTheBuidler wants to merge 5 commits into
python:masterfrom
BobTheBuidler:patch-17

Conversation

@BobTheBuidler

Copy link
Copy Markdown
Contributor

TODO

]

if items is not None:
assert left is not None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I wonder if it would be worth weaving the item-getting process into the equality checks so in some cases we can exit early without fully loading the tuple items

if None not in literal_items:
# If all tuple items are literals we don't even need to accept the tuple
# TODO: should we use object_rprimitive? prob not, what do?
items = [LoadLiteral(literal.value, object_rprimitive) for literal in literal_items]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if all items are literals we can probably have a fast-false path via type check, and if the type check passes the subsequent equality checks will be much faster

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.

1 participant