Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# TODO: Allowlist entries that should be fixed
# ============================================

_frozen_importlib_external.PathFinder.discover
dataclasses.MISSING
dataclasses._MISSING_TYPE
dataclasses.field
Expand Down
15 changes: 12 additions & 3 deletions stdlib/_frozen_importlib_external.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class PathFinder(importlib.abc.MetaPathFinder):
@deprecated("Deprecated since Python 3.4; removed in Python 3.12. Use `find_spec()` instead.")
def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ...

if sys.version_info >= (3, 15):
@classmethod
def discover(cls, parent: ModuleSpec | None = None) -> Iterator[ModuleSpec]: ...

SOURCE_SUFFIXES: Final[list[str]]
DEBUG_BYTECODE_SUFFIXES: Final = [".pyc"]
OPTIMIZED_BYTECODE_SUFFIXES: Final = [".pyc"]
Expand All @@ -88,6 +92,9 @@ class FileFinder(importlib.abc.PathEntryFinder):
cls, *loader_details: tuple[type[importlib.abc.Loader], list[str]]
) -> Callable[[str], importlib.abc.PathEntryFinder]: ...

if sys.version_info >= (3, 15):
def discover(self, parent: ModuleSpec | None = None) -> Iterator[ModuleSpec]: ...

class _LoaderBasics:
def is_package(self, fullname: str) -> bool: ...
def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ...
Expand Down Expand Up @@ -153,7 +160,7 @@ class ExtensionFileLoader(FileLoader, _LoaderBasics, importlib.abc.ExecutionLoad
if sys.version_info >= (3, 15):
class NamespacePath:
def __init__(
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec]
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec | None]
) -> None: ...
def __iter__(self) -> Iterator[str]: ...
def __getitem__(self, index: int) -> str: ...
Expand All @@ -162,10 +169,12 @@ if sys.version_info >= (3, 15):
def __contains__(self, item: str) -> bool: ...
def append(self, item: str) -> None: ...

_NamespacePath = NamespacePath

if sys.version_info >= (3, 11):
class NamespaceLoader(importlib.abc.InspectLoader):
def __init__(
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec]
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec | None]
) -> None: ...
def is_package(self, fullname: str) -> Literal[True]: ...
def get_source(self, fullname: str) -> Literal[""]: ...
Expand All @@ -188,7 +197,7 @@ if sys.version_info >= (3, 11):
else:
class _NamespaceLoader:
def __init__(
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec]
self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec | None]
) -> None: ...
def is_package(self, fullname: str) -> Literal[True]: ...
def get_source(self, fullname: str) -> Literal[""]: ...
Expand Down