Skip to content

Types from the typing module that don't exist in the specified Python version are not detected by Mypy #6593

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

Closed
matthewslouismarie opened this issue Mar 26, 2019 · 4 comments

Comments

@matthewslouismarie
Copy link

Hello there,

I think this is not the desired behaviour of Mypy. If I set the version of Python to 3.5, it doesn't report Deque imports, even though this type only appeared in Python 3.6.

mypy.ini:

[mypy]
python_version = 3.5

The python code:

from typing import Deque

...

This does not report any errors with mypy 0.670.

@gvanrossum
Copy link
Member

Thanks for reporting! But it's not a flaw in mypy itself, it's in typeshed, which has a separate repo: https://github.com/python/typeshed. Please report it there!

@ilevkivskyi
Copy link
Member

These type aliases (Deque etc) are added dynamically by mypy for subtle reasons, so this can't be fixed in typeshed. I think we can track this as part of #3413 (although it is not the same issue, the two should be probably fixed together).

@gvanrossum
Copy link
Member

OK, reopening.

@AlexWaygood
Copy link
Member

Python 3.5 is no longer supported by mypy, and I can't reproduce this with any other aliases, so I'm closing this.

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

No branches or pull requests

4 participants