-
-
Notifications
You must be signed in to change notification settings - Fork 3k
globl "type: ignore" ignores too much #13435
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
Duplicate of #12076 |
@hauntsaninja seems it's another bug. It's not about ignoring specific rule. Please reopen |
@hauntsaninja I have checked. Yes, just global ignore line still reproduces the bug (and I edited the example). Who to trigger for this issue ? |
I think this is just the documented behaviour? https://mypy.readthedocs.io/en/stable/common_issues.html#ignoring-a-whole-file |
@hauntsaninja I think no: I understand as In my case, something different happens. |
Yes, in your case mypy ignores that entire module. You probably want the ignore_errors configuration: So something like I agree that this is confusing, but not sure how to change in a backward compatible manner. (I'm also here for fun and am not personally motivated to fix confusing mypy configuration) |
OK I will try. But could you fix the documentation? I mean correcting the ambiguity of the phrase above. |
Per-module error codes were added in python#13502, let's recommend using them. The existing type ignore behaviour is pretty unintuitive; I think most people actually want `# mypy: ignore-errors`. There are probably people depending on the current behaviour though. Fixes python#13435, fixes python#12076, fixes python#11999, fixes python#11027, fixes python#9318, fixes python#7839
Per-module error codes were added in #13502, let's recommend using them. The existing type ignore behaviour is pretty unintuitive; I think most people actually want `# mypy: ignore-errors`. There are probably people depending on the current behaviour though. Fixes #13435, fixes #12076, fixes #11999, fixes #11027, fixes #9318, fixes #7839
Uh oh!
There was an error while loading. Please reload this page.
Structure:
sample_proj/__init__.py
:sample_proj/comons.py
:sample_proj/some_file.py
:I think it's a bug.
Removing
# type: ignore[union-attr]
helps. I wanted this comment to ignore only this exact error in the whole file.The text was updated successfully, but these errors were encountered: