Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Tuple multiply literal - #10361

Merged
hauntsaninja merged 7 commits into
python:masterfrom
hatal175:TupleMultiplyLiteral
Aug 4, 2021
Merged

Tuple multiply literal#10361
hauntsaninja merged 7 commits into
python:masterfrom
hatal175:TupleMultiplyLiteral

Conversation

@hatal175

Copy link
Copy Markdown
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
Copy Markdown
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

hatal175 commented Apr 23, 2021 via email

Copy link
Copy Markdown
Contributor Author

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

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.

Comment thread test-data/unit/pythoneval.test Outdated
@hatal175

hatal175 commented May 2, 2021

Copy link
Copy Markdown
Contributor Author

Done as requested.

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

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