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
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# ============================================

_frozen_importlib_external.PathFinder.discover
_frozen_importlib_external.SourceFileLoader.source_to_code
_frozen_importlib_external.SourceLoader.source_to_code
dataclasses.MISSING
dataclasses._MISSING_TYPE
dataclasses.field
Expand Down
28 changes: 18 additions & 10 deletions stdlib/_frozen_importlib_external.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,24 @@ class SourceLoader(_LoaderBasics):
def set_data(self, path: str, data: bytes) -> None: ...
def get_source(self, fullname: str) -> str | None: ...
def path_stats(self, path: str) -> Mapping[str, Any]: ...
def source_to_code(
self, data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: bytes | StrPath
) -> types.CodeType: ...
if sys.version_info >= (3, 15):
def source_to_code(
self,
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive,
path: bytes | StrPath,
fullname: str | None = None,
*,
_optimize: int = -1,
) -> types.CodeType: ...
else:
def source_to_code(
self,
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive,
path: bytes | StrPath,
*,
_optimize: int = -1,
) -> types.CodeType: ...

def get_code(self, fullname: str) -> types.CodeType | None: ...

class FileLoader:
Expand All @@ -120,13 +135,6 @@ class FileLoader:
class SourceFileLoader(importlib.abc.FileLoader, FileLoader, importlib.abc.SourceLoader, SourceLoader): # type: ignore[misc] # incompatible method arguments in base classes
def set_data(self, path: str, data: ReadableBuffer, *, _mode: int = 0o666) -> None: ...
def path_stats(self, path: str) -> Mapping[str, Any]: ...
def source_to_code( # type: ignore[override] # incompatible with InspectLoader.source_to_code
self,
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive,
path: bytes | StrPath,
*,
_optimize: int = -1,
) -> types.CodeType: ...

class SourcelessFileLoader(importlib.abc.FileLoader, FileLoader, _LoaderBasics):
def get_code(self, fullname: str) -> types.CodeType | None: ...
Expand Down