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

Tuple multiply literal #10361

Merged
merged 7 commits into from
Aug 4, 2021
Merged

Conversation

hatal175
Copy link
Contributor

Description

Fixes #863.

I've added a method hook that given an int literal multiplied by a tuple gives the correct specific sized tuple.

Test Plan

I've added more python evaulation tests and mypy_primer should cover enough of a regression test.

@github-actions

This comment has been minimized.

@JelleZijlstra
Copy link
Member

mypy-primer found it crashing at https://github.com/google/jax/blob/master/jax/_src/lax/other.py#L96, apparently on a Tuple[int, ...].

@hatal175
Copy link
Contributor Author

hatal175 commented Apr 23, 2021 via email

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, I'd just prefer to have these tests use the test fixtures instead of full stubs, since tests using full stubs are a lot slower to run.

test-data/unit/pythoneval.test Outdated Show resolved Hide resolved
@hatal175
Copy link
Contributor Author

hatal175 commented May 2, 2021

Done as requested.

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 updates! Looks good based on a quick review pass.

Since we are (hopefully) close to a mypy release, I won't merge this until I've cut a release branch. Changes to type inference frequently have hard-to-find edge cases, so I'd prefer to merge this early in a release process to that there will be more time for testing.

@hauntsaninja hauntsaninja merged commit 14eaa18 into python:master Aug 4, 2021
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.

Multiply Tuple with IntExpr
4 participants