mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Add stub for PathFinder and remove whitelist (#3885)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import importlib.abc
|
||||
import types
|
||||
from typing import Any, Callable, List, Optional, Sequence, Tuple
|
||||
from typing import Any, Callable, List, Optional, Sequence, Tuple, Union
|
||||
|
||||
# ModuleSpec is exported from this module, but for circular import
|
||||
# reasons exists in its own stub file (with Loader and ModuleType).
|
||||
from _importlib_modulespec import ModuleSpec as ModuleSpec # Exported
|
||||
from _importlib_modulespec import ModuleSpec as ModuleSpec, Loader # Exported
|
||||
|
||||
class BuiltinImporter(importlib.abc.MetaPathFinder,
|
||||
importlib.abc.InspectLoader):
|
||||
@@ -81,7 +81,17 @@ class WindowsRegistryFinder(importlib.abc.MetaPathFinder):
|
||||
target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]:
|
||||
...
|
||||
|
||||
class PathFinder(importlib.abc.MetaPathFinder): ...
|
||||
class PathFinder:
|
||||
@classmethod
|
||||
def invalidate_caches(cls) -> None: ...
|
||||
@classmethod
|
||||
def find_spec(cls, fullname: str,
|
||||
path: Optional[Sequence[Union[bytes, str]]] = ...,
|
||||
target: Optional[types.ModuleType] = ...) -> Optional[ModuleSpec]: ...
|
||||
@classmethod
|
||||
def find_module(cls, fullname: str,
|
||||
path: Optional[Sequence[Union[bytes, str]]] = ...) -> Optional[Loader]: ...
|
||||
|
||||
|
||||
SOURCE_SUFFIXES: List[str]
|
||||
DEBUG_BYTECODE_SUFFIXES: List[str]
|
||||
|
||||
@@ -287,9 +287,6 @@ importlib.machinery.ExtensionFileLoader.get_filename
|
||||
importlib.machinery.FrozenImporter.find_module
|
||||
importlib.machinery.FrozenImporter.find_spec
|
||||
importlib.machinery.FrozenImporter.module_repr
|
||||
importlib.machinery.PathFinder.find_module
|
||||
importlib.machinery.PathFinder.find_spec
|
||||
importlib.machinery.PathFinder.invalidate_caches
|
||||
importlib.machinery.SourceFileLoader.set_data
|
||||
importlib.machinery.WindowsRegistryFinder.find_module
|
||||
importlib.machinery.WindowsRegistryFinder.find_spec
|
||||
|
||||
Reference in New Issue
Block a user