@@ -9,6 +9,8 @@ from abc import ABCMeta
9
9
import sys
10
10
from typing import Any , Optional
11
11
12
+ MYPY_MODULE = 'importlib.machinery'
13
+
12
14
if sys .version_info >= (3 , 4 ):
13
15
class ModuleSpec :
14
16
def __init__ (self , name : str , loader : Optional ['Loader' ], * ,
@@ -23,6 +25,8 @@ if sys.version_info >= (3, 4):
23
25
parent = ... # type: Optional[str]
24
26
has_location = ... # type: bool
25
27
28
+ MYPY_MODULE = 'types'
29
+
26
30
class ModuleType :
27
31
__name__ = ... # type: str
28
32
__file__ = ... # type: str
@@ -32,6 +36,8 @@ class ModuleType:
32
36
__spec__ = ... # type: Optional[ModuleSpec]
33
37
def __init__ (self , name : str , doc : Optional [str ] = ...) -> None : ...
34
38
39
+ MYPY_MODULE = 'importlib.abc'
40
+
35
41
class Loader (metaclass = ABCMeta ):
36
42
def load_module (self , fullname : str ) -> ModuleType : ...
37
43
if sys .version_info >= (3 , 3 ):
@@ -41,3 +47,4 @@ class Loader(metaclass=ABCMeta):
41
47
# Not defined on the actual class for backwards-compatibility reasons,
42
48
# but expected in new code.
43
49
def exec_module (self , module : ModuleType ) -> None : ...
50
+
0 commit comments