Based on this SO question, I tried this code:
import types
def f() -> types.ModuleType:
return types
and it failed type check with Incompatible return value type (got "module", expected "ModuleType"). I think names exported in types.* are appropriate for cases like this?