You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried doing # type: (module) -> str and MyPy was okay with it, but our linter was not. Some discussion in our Slack channel:
Guido:
From types import ModuleType?
Oh wow. Please file a bug. Mypy uses builtins.module but that doesn't exist so can't be used at runtime; types.ModuleType exists but mypy doesn't understand it.
David Fisher:
oh interesting
we have a "class module" entry in builtins
with the comment # TODO not defined in builtins!
The text was updated successfully, but these errors were encountered:
Yeah, so apparently when mypy sees a variable that's a module (as opposed to just an import statement) it gives it the type builtins.module even though that doesn't exist. The actual type of module objects is types.ModuleType. This would probably be easy to fix.
I tried doing
# type: (module) -> str
and MyPy was okay with it, but our linter was not. Some discussion in our Slack channel:The text was updated successfully, but these errors were encountered: