Open asottile-sentry opened 1 week ago
It looks like this happens because importlib
indirectly imports importlib.metadata
in typeshed (importlib
imports importlib.abc
which imports importlib._bootstrap_external
which imports _frozen_importlib_external
which finally imports importlib.metadata
), so mypy considers importlib.metadata
to exist, despite this not being the case at runtime.
Bug Report
mypy seems to assume that
import importlib
brings in the relevant submodules (though I can't see anything in typeshed that would indicate this?) even though it does notimportlib.metadata
is not implicitly brought in byimportlib
:To Reproduce
Expected Behavior
I expect two errors, but I only get one
Actual Behavior
Your Environment
mypy.ini
(and other config files): n/a