We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
I've created a file.py with the following content,
file.py
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.
b
Note this relates to a typing issue in Flask.
The text was updated successfully, but these errors were encountered:
This bug is reproducible with mypy 1.5.1, but has already been fixed on the master branch: https://mypy-play.net/?mypy=master&python=3.11&gist=2f5367d2a6b23d57ad81f2aabbcbe5ea. It was likely fixed by #16122 (but I haven't checked that).
(The fix probably won't be included in mypy 1.6, unfortunately; you'll probably have to wait for mypy 1.7.)
Sorry, something went wrong.
Thanks, great to hear it has been fixed.
No branches or pull requests
I've created a
file.py
with the following content,Then installed mypy (Python 3.11.1),
Which gives this error,
Which is odd as line 4 (the
b
assignment) is fine.Note this relates to a typing issue in Flask.
The text was updated successfully, but these errors were encountered: