Closed
Description
The following example from the 3.9.0 type hinting docs:
Vector = list[float]
makes mypy complain that:
"list" is not subscriptable, use "typing.List" instead
This differs from 3.8 docs in that they actually use typing.List instead. Is this a doc issue or a mypy issue?
I am aware that I can use typing.List for this case, but if there's an option to not include a module, I would rather take that option.
To Reproduce
- Create a Python file with the content above
- Run through mypy
- Observe that it complains about how "list is not subscriptable" and that I should use typing.List instead
Expected Behavior
I expect it to not complain.
Actual Behavior
It complains.
Your Environment
VSCode with mypy as linter.
- Mypy version used: 0.79
- Python version used: 3.9
- Operating system and version: Win10