massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stdlib / importlib / machinery.pyi
1 import importlib.abc
2 import types
3 from typing import Any, Callable, Sequence
4
5 class ModuleSpec:
6     def __init__(
7         self,
8         name: str,
9         loader: importlib.abc.Loader | None,
10         *,
11         origin: str | None = ...,
12         loader_state: Any = ...,
13         is_package: bool | None = ...,
14     ) -> None: ...
15     name: str
16     loader: importlib.abc.Loader | None
17     origin: str | None
18     submodule_search_locations: list[str] | None
19     loader_state: Any
20     cached: str | None
21     parent: str | None
22     has_location: bool
23
24 class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
25     # MetaPathFinder
26     @classmethod
27     def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ...
28     @classmethod
29     def find_spec(
30         cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ...
31     ) -> ModuleSpec | None: ...
32     # InspectLoader
33     @classmethod
34     def is_package(cls, fullname: str) -> bool: ...
35     @classmethod
36     def load_module(cls, fullname: str) -> types.ModuleType: ...
37     @classmethod
38     def get_code(cls, fullname: str) -> None: ...
39     @classmethod
40     def get_source(cls, fullname: str) -> None: ...
41     # Loader
42     @staticmethod
43     def module_repr(module: types.ModuleType) -> str: ...
44     @classmethod
45     def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ...
46     @classmethod
47     def exec_module(cls, module: types.ModuleType) -> None: ...
48
49 class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
50     # MetaPathFinder
51     @classmethod
52     def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ...
53     @classmethod
54     def find_spec(
55         cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ...
56     ) -> ModuleSpec | None: ...
57     # InspectLoader
58     @classmethod
59     def is_package(cls, fullname: str) -> bool: ...
60     @classmethod
61     def load_module(cls, fullname: str) -> types.ModuleType: ...
62     @classmethod
63     def get_code(cls, fullname: str) -> None: ...
64     @classmethod
65     def get_source(cls, fullname: str) -> None: ...
66     # Loader
67     @staticmethod
68     def module_repr(m: types.ModuleType) -> str: ...
69     @classmethod
70     def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ...
71     @staticmethod
72     def exec_module(module: types.ModuleType) -> None: ...
73
74 class WindowsRegistryFinder(importlib.abc.MetaPathFinder):
75     @classmethod
76     def find_module(cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ...) -> importlib.abc.Loader | None: ...
77     @classmethod
78     def find_spec(
79         cls, fullname: str, path: Sequence[importlib.abc._Path] | None = ..., target: types.ModuleType | None = ...
80     ) -> ModuleSpec | None: ...
81
82 class PathFinder:
83     @classmethod
84     def invalidate_caches(cls) -> None: ...
85     @classmethod
86     def find_spec(
87         cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ...
88     ) -> ModuleSpec | None: ...
89     @classmethod
90     def find_module(cls, fullname: str, path: Sequence[bytes | str] | None = ...) -> importlib.abc.Loader | None: ...
91
92 SOURCE_SUFFIXES: list[str]
93 DEBUG_BYTECODE_SUFFIXES: list[str]
94 OPTIMIZED_BYTECODE_SUFFIXES: list[str]
95 BYTECODE_SUFFIXES: list[str]
96 EXTENSION_SUFFIXES: list[str]
97
98 def all_suffixes() -> list[str]: ...
99
100 class FileFinder(importlib.abc.PathEntryFinder):
101     path: str
102     def __init__(self, path: str, *loader_details: tuple[importlib.abc.Loader, list[str]]) -> None: ...
103     @classmethod
104     def path_hook(
105         cls, *loader_details: tuple[importlib.abc.Loader, list[str]]
106     ) -> Callable[[str], importlib.abc.PathEntryFinder]: ...
107
108 class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader):
109     def set_data(self, path: importlib.abc._Path, data: bytes, *, _mode: int = ...) -> None: ...
110
111 class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ...
112
113 class ExtensionFileLoader(importlib.abc.ExecutionLoader):
114     def __init__(self, name: str, path: importlib.abc._Path) -> None: ...
115     def get_filename(self, name: str | None = ...) -> importlib.abc._Path: ...
116     def get_source(self, fullname: str) -> None: ...
117     def create_module(self, spec: ModuleSpec) -> types.ModuleType: ...
118     def exec_module(self, module: types.ModuleType) -> None: ...
119     def is_package(self, fullname: str) -> bool: ...
120     def get_code(self, fullname: str) -> None: ...