-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Disabling mypy for certain modules? #545
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
Comments
I thought this was always a TODO? |
Skipping type checking of modules that don't import However, using (Apologies if the above is incoherent. I'm traveling with kids in Europe and still a bit jet lagged.) |
The PEP 484 sanctioned way to do this is to add
I'm not sure if we should also support |
This is now supported:
|
I thought it used to be the case that mypy only checked modules that explicitly import [from] typing. That gave a nice "out" for existing code that uses annotations with different conventions. But checking with the most recent version I found that it no longer does this -- all imported modules get checked, and all annotations it doesn't understand get flagged. I worry that this will upset people who have put efforts into their own system using annotation, and I think it's at least reasonable to be able to flag such code as "don't look here".
You can probably do this using a stub module, but perhaps it should be possible to just write something like
Or some other syntax at the importing site?
We can also think about disabling mypy checking for a smaller scope, e.g. a class or function -- maybe a class annotation @dont_type_check?
(Hm... Did I already bring this up earlier? If so please just close as duplicate.)
The text was updated successfully, but these errors were encountered: