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
New "module has no attribute" errors in 0.710 #7030
Comments
This is a result of the new --no-implicit-reexports flag, which is part of
--strict. See
https://mypy.readthedocs.io/en/latest/command_line.html#miscellaneous-strictness-flags
It can be fixed by doing `import qaz as qaz`.
…On Thu, Jun 20, 2019, 11:03 Greg Bedwell ***@***.***> wrote:
This is a change in behaviour I've noticed in 0.710. I can't help but
think it's so simple that I'm obviously doing something very wrong, but I
can't obviously see what. My apologies for wasting your time if it is user
error! None of the other checking/linting tools I've tried warn about any
issues here.
Here's a reproducer for what I'm seeing:
(py3.6) e:\tmp\mypy-issue>cat foo.py
from bar import qaz
print(qaz())
(py3.6) e:\tmp\mypy-issue>cat bar\__init__.py
from bar.baz import qaz
__all__ = [
'qaz',
]
(py3.6) e:\tmp\mypy-issue>cat bar\baz.py
def qaz() -> int:
return 42
(py3.6) e:\tmp\mypy-issue>python --version
Python 3.6.4
(py3.6) e:\tmp\mypy-issue>python foo.py
42
(py3.6) e:\tmp\mypy-issue>pip install -q "mypy<0.710"
(py3.6) e:\tmp\mypy-issue>mypy --version
mypy 0.701
(py3.6) e:\tmp\mypy-issue>mypy --strict .
(py3.6) e:\tmp\mypy-issue>pip install -q "mypy==0.710"
(py3.6) e:\tmp\mypy-issue>mypy --version
mypy 0.710
(py3.6) e:\tmp\mypy-issue>mypy --strict .
foo.py:1: error: Module 'bar' has no attribute 'qaz'
(py3.6) e:\tmp\mypy-issue>
Let me know if you need any more information.
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7030?email_source=notifications&email_token=AACTC7LX4KKH23RBQFFIDS3P3PA7BA5CNFSM4HZZLD42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2YU3ZQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACTC7OKRAC356VYJUPGWSLP3PA7BANCNFSM4HZZLD4Q>
.
|
Ah. Brilliant. Thanks! Sorry for the noise |
@msullivan this is blocking when this happens in a dependency (I want to access Should I just run mypy with And/or should I ask the lib to export it using |
4 tasks
This was referenced Dec 29, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a change in behaviour I've noticed in 0.710. I can't help but think it's so simple that I'm obviously doing something very wrong, but I can't obviously see what. My apologies for wasting your time if it is user error! None of the other checking/linting tools I've tried warn about any issues here.
Here's a reproducer for what I'm seeing:
Let me know if you need any more information.
Thanks!
The text was updated successfully, but these errors were encountered: