8000 Fix new style union syntax in type aliases by JukkaL · Pull Request #14008 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Fix new style union syntax in type aliases #14008

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 14 commits into from
Nov 7, 2022
Prev Previous commit
Next Next commit
Update test case
  • Loading branch information
JukkaL committed Nov 4, 2022
commit 6726101c8ceda8c15b889d6eb94207f72cb39315
5 changes: 4 additions & 1 deletion test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,7 @@ _testNarrowTypeForDictKeys.py:16: note: Revealed type is "Union[builtins.str, No

[case testTypeAliasWithNewStyleUnion]
# flags: --python-version 3.10
from typing import Literal
from typing import Literal, Type, TypeAlias

Foo = Literal[1, 2]
reveal_type(Foo)
Expand All @@ -1678,5 +1678,8 @@ Opt1 = None | int
Opt2 = None | float
Opt3 = int | None
Opt4 = float | None

A = Type[int] | str
B: TypeAlias = Type[int] | str
[out]
_testTypeAliasWithNewStyleUnion.py:5: note: Revealed type is "typing._SpecialForm"
0