1 # ModuleSpec, ModuleType, Loader are part of a dependency cycle.
\r
2 # They are officially defined/exported in other places:
\r
4 # - ModuleType in types
\r
5 # - Loader in importlib.abc
\r
6 # - ModuleSpec in importlib.machinery (3.4 and later only)
\r
8 from abc import ABCMeta
\r
10 from typing import Any, Dict, List, Optional
\r
13 def __init__(self, name: str, loader: Optional['Loader'], *,
\r
14 origin: Optional[str] = ..., loader_state: Any = ...,
\r
15 is_package: Optional[bool] = ...) -> None: ...
\r
16 name = ... # type: str
\r
17 loader = ... # type: Optional[Loader]
\r
18 origin = ... # type: Optional[str]
\r
19 submodule_search_locations = ... # type: Optional[List[str]]
\r
20 loader_state = ... # type: Any
\r
21 cached = ... # type: Optional[str]
\r
22 parent = ... # type: Optional[str]
\r
23 has_location = ... # type: bool
\r
26 __name__ = ... # type: str
\r
27 __file__ = ... # type: str
\r
28 __dict__ = ... # type: Dict[str, Any]
\r
29 __loader__ = ... # type: Optional[Loader]
\r
30 __package__ = ... # type: Optional[str]
\r
31 __spec__ = ... # type: Optional[ModuleSpec]
\r
32 def __init__(self, name: str, doc: Optional[str] = ...) -> None: ...
\r
34 class Loader(metaclass=ABCMeta):
\r
35 def load_module(self, fullname: str) -> ModuleType: ...
\r
36 def module_repr(self, module: ModuleType) -> str: ...
\r
37 def create_module(self, spec: ModuleSpec) -> Optional[ModuleType]: ...
\r
38 # Not defined on the actual class for backwards-compatibility reasons,
\r
39 # but expected in new code.
\r
40 def exec_module(self, module: ModuleType) -> None: ...
\r