8000 Fix crash when a star expression is used in isinstance by onlined · Pull Request #6659 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix crash when a star expression is used in isinstance #6659

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

Merged
merged 6 commits into from
Apr 12, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove extra blank lines
  • Loading branch information
ilevkivskyi authored Apr 12, 2019
commit 4d0126c98eb375c786bb296a3ddfd0da0ced54d0
2 changes: 0 additions & 2 deletions test-data/unit/check-isinstance.test
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,6 @@ def bar(x: Union[List[str], List[int], None]) -> None:
[case testIsInstanceWithStarExpression]
from typing import Union, List, Tuple


def f(var: Union[List[str], Tuple[str, str], str]) -> None:
reveal_type(var) # E: Revealed type is 'Union[builtins.list[builtins.str], Tuple[builtins.str, builtins.str], builtins.str]'
if isinstance(var, (list, *(str, int))):
Expand All @@ -2221,7 +2220,6 @@ def f(var: Union[List[str], Tuple[str, str], str]) -> None:
[case testIsInstanceWithStarExpressionAndVariable]
from typing import Union


def f(var: Union[int, str]) -> None:
reveal_type(var) # E: Revealed type is 'Union[builtins.int, builtins.str]'
some_types = (str, tuple)
Expand Down
0