Skip to content
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

Type hinting example from 3.9.0 docs don't work (v0.79) #9740

Closed
tekinozbek opened this issue Nov 21, 2020 · 1 comment
Closed

Type hinting example from 3.9.0 docs don't work (v0.79) #9740

tekinozbek opened this issue Nov 21, 2020 · 1 comment
Labels
bug mypy got something wrong

Comments

@tekinozbek
Copy link

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

  1. Create a Python file with the content above
  2. Run through mypy
  3. 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
@tekinozbek tekinozbek added the bug mypy got something wrong label Nov 21, 2020
@hauntsaninja
Copy link
Collaborator

mypy doesn't yet fully support 3.9. Closing as a dupe of #9564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

2 participants