-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Labels
bugmypy got something wrongmypy got something wrong
Description
I've created a file.py
with the following content,
from typing import Any, Mapping
a: tuple[Mapping[str, Any], dict] | tuple[Mapping[str, Any], int] = {}, 200
b: tuple[Mapping[str, Any], int] = {}, 200
Then installed mypy (Python 3.11.1),
$ pip install mypy
Collecting mypy
Using cached mypy-1.5.1-cp311-cp311-macosx_10_9_x86_64.whl (10.5 MB)
Collecting typing-extensions>=4.1.0
Using cached typing_extensions-4.8.0-py3-none-any.whl (31 kB)
Collecting mypy-extensions>=1.0.0
Using cached mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)
Installing collected packages: typing-extensions, mypy-extensions, mypy
Successfully installed mypy-1.5.1 mypy-extensions-1.0.0 typing-extensions-4.8.0
Which gives this error,
mypy file.py
file.py:3: error: Incompatible types in assignment (expression has type "tuple[dict[<nothing>, <nothing>], int]", variable has type "tuple[Mapping[str, Any], dict[Any, Any]] | tuple[Mapping[str, Any], int]") [assignment]
Found 1 error in 1 file (checked 1 source file)
Which is odd as line 4 (the b
assignment) is fine.
Note this relates to a typing issue in Flask.
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong