Skip to content

Fails mypy --strict because of reexports #3868

Closed
@AMDmi3

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

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions