-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
"# type: ignore[no-redef]" causing "Module 'x' has no attribute 'y'" errors. #8016
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
Hm, this is interesting. This is an artefact of how top-level So this is essentially a duplicate of #7839 (there is also a workaround mentioned). |
Thanks for the quick reply @ilevkivskyi ! I really appreciate it. So The code does register key bindings callbacks like this in the snippet below, and I don't like to think of hundreds of different names for functions that are never called by that name. @handle_key('control-c')
def _():
...
@handle_key('control-a')
... If I could configure mypy to ignore Thanks again. I'll see when a fix arrives. :-) |
Yes, support for selectively silencing error codes is planned in near future (see #7599) |
This is probably a bug in mypy.
It can be reproduced by creating a directory
a
with only two files in there: an__init__.py
andb.py
and
Mypy gives the following output:
Remove the
type: ignore[no-redef]
and mypy succeeds.I would not expect that ignoring something (even leaving
type: ignore
in there makes mypy fail), would break the imports.This is an issue for prompt_toolkit: prompt-toolkit/python-prompt-toolkit#1008
The text was updated successfully, but these errors were encountered: