What is the type hint for a (any) python module?
问题 I would like to add the (Python3) type hint for a module (class 'module'). The typing package doesn't provide one, and types.ModuleType() is a constructor that returns a module object for a specific name. Example: import types def foo(module: types.ModuleType): pass at least in PyCharm results in "Cannot find reference ModuleType in types.pyi". 回答1: and types.ModuleType() is a constructor. That doesn't matter. types.ModuleType is still a reference to a type, just like str and int are. There