Skip to content
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

[mypyc] Modify specializers and add int.__pow__ in test-data/fixture #10448

Merged
merged 4 commits into from
May 25, 2021

Conversation

97littleleaf11
Copy link
Collaborator

@97littleleaf11 97littleleaf11 commented May 8, 2021

Description

  • Move simple tuple and list creation to new functions. Each specializer only focus on one situation now.
  • Add int.__pow__ in test-data/fixture

Test Plan

This change should pass all existing tests.

@97littleleaf11
Copy link
Collaborator Author

97littleleaf11 commented May 9, 2021

The following test case leads to a test failure:

source_e = [0, 1, 2]
e = list((x ** 2) for x in (y + 2 for y in source_e))
assert e == [4, 9, 16]

Got this when testing

Unsupported left operand type for ** ("int")

However I cannot reproduce this by direct compilation.

@TH3CHARLie
Copy link
Collaborator

my guess is that you need to modify the fixture you are using

@97littleleaf11 97littleleaf11 changed the title [mypyc] Modify specializers [mypyc] Modify specializers and add int.__pow__ in test-data/fixture May 20, 2021
Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good. It's easier to understand specializers if each of them does one thing only.

@JukkaL JukkaL merged commit 7780482 into python:master May 25, 2021
@97littleleaf11 97littleleaf11 deleted the modify-specializer branch May 26, 2021 08:41
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.

3 participants