You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypy does not support PEP 613 -- Explicit Type Aliases (python 3.10)
To Reproduce
Include an explicit type alias in your code, like the following:
TEMP: TypeAlias = tuple[str, str]
2. execute mypy on that file, and it will complain with the message pasted below.
Expected Behavior
Explicit Type aliases should be supported by mypy if python 3.10+ is used.
Actual Behavior
When I execute mypy on my file containing an explicit type alias, I get:
❯ mypy my_file.py
my_file.py:10: error: Variable "typing.TypeAlias" is not valid as a type
my_file.py:10: note: See https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases
my_file.py:10: error: Type application has too many types (1 expected)
Your Environment
Mypy version used: 0.812
Mypy command-line flags: None
Mypy configuration options from mypy.ini (and other config files): None
Python version used: 3.10
Operating system and version: Ubuntu, 5.11.0-37-generic Refactor code into packages #41-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
Bug Report
mypy does not support PEP 613 -- Explicit Type Aliases (python 3.10)
To Reproduce
TEMP: TypeAlias = tuple[str, str]
2. execute mypy on that file, and it will complain with the message pasted below.
Expected Behavior
Explicit Type aliases should be supported by mypy if python 3.10+ is used.
Actual Behavior
When I execute mypy on my file containing an explicit type alias, I get:
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: