Closed
Description
Long story short
With python 3.7, fresh mypy 0.711:
import aiohttp
aiohttp.ClientSession
% mypy --strict test.py
test.py:3: error: Module has no attribute "ClientSession"
This happens because mypy --strict
expects imported stuff reexported as in
from .client import BaseConnector as BaseConnector
while aiohttp/__init.py__
just imports stuff:
from .client import (BaseConnector, ...)
Related: python/mypy#7067
Expected behaviour
Clean mypy --strict
, as these errors break checking code which uses aiohttp
Activity
webknjaz commentedon Jun 25, 2019
Feel free to send a PR :)
AMDmi3 commentedon Jun 26, 2019
Would it be OK stylewise to just convert to a bunch of
from .foo import bar as bar
lines?webknjaz commentedon Jun 26, 2019
That's a question to @asvetlov. I don't mind personally.
asvetlov commentedon Jun 26, 2019
Yes. Whatever works for you and
isort
tool :)Please make sure that both
__init__.py
andweb.py
are processed.[mypy]
section fromsetup.cfg
worth to be upgraded to support the most strict mode.The problem is that
mypy
doesn't supportstrict=true
in config files but requires decomposition of this mode into a bunch of separate flags.mypy
is expanding, new options are added to the tool but we didn't change our config file yet.Use correct style for re-exported imports (aio-libs#3868)
[3.5] Use correct style for re-exported imports (aio-libs#3868)
Add CHANGES entry for aio-libs#3868
Add CHANGES entry for aio-libs#3868
[3.5] Add CHANGES entry for aio-libs#3868
30 remaining items