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
4 changes: 2 additions & 2 deletions stdlib/_frozen_importlib_external.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class SourceLoader(_LoaderBasics):
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: ReadableBuffer | StrPath
self, data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: bytes | StrPath
) -> types.CodeType: ...
def get_code(self, fullname: str) -> types.CodeType | None: ...

Expand All @@ -126,7 +126,7 @@ class SourceFileLoader(importlib.abc.FileLoader, FileLoader, importlib.abc.Sourc
def source_to_code( # type: ignore[override] # incompatible with InspectLoader.source_to_code
self,
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive,
path: ReadableBuffer | StrPath,
path: bytes | StrPath,
*,
_optimize: int = -1,
) -> types.CodeType: ...
Expand Down
24 changes: 12 additions & 12 deletions stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: _T,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
Expand All @@ -1757,7 +1757,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
Expand All @@ -1767,7 +1767,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["eval"],
*,
type_comments: bool = False,
Expand All @@ -1777,7 +1777,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["func_type"],
*,
type_comments: bool = False,
Expand All @@ -1787,7 +1787,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["single"],
*,
type_comments: bool = False,
Expand Down Expand Up @@ -1824,7 +1824,7 @@ if sys.version_info >= (3, 13):
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: str = "exec",
*,
type_comments: bool = False,
Expand All @@ -1836,7 +1836,7 @@ else:
@overload
def parse(
source: _T,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
Expand All @@ -1845,7 +1845,7 @@ else:
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
Expand All @@ -1854,7 +1854,7 @@ else:
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["eval"],
*,
type_comments: bool = False,
Expand All @@ -1863,7 +1863,7 @@ else:
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["func_type"],
*,
type_comments: bool = False,
Expand All @@ -1872,7 +1872,7 @@ else:
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any],
filename: str | bytes | os.PathLike[Any],
mode: Literal["single"],
*,
type_comments: bool = False,
Expand Down Expand Up @@ -1905,7 +1905,7 @@ else:
@overload
def parse(
source: str | ReadableBuffer,
filename: str | ReadableBuffer | os.PathLike[Any] = "<unknown>",
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: str = "exec",
*,
type_comments: bool = False,
Expand Down
8 changes: 4 additions & 4 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ if sys.version_info >= (3, 10):
@overload
def compile(
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
filename: str | ReadableBuffer | PathLike[Any],
filename: str | bytes | PathLike[Any],
mode: str,
flags: Literal[0],
dont_inherit: bool = False,
Expand All @@ -1412,7 +1412,7 @@ def compile(
@overload
def compile(
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
filename: str | ReadableBuffer | PathLike[Any],
filename: str | bytes | PathLike[Any],
mode: str,
*,
dont_inherit: bool = False,
Expand All @@ -1422,7 +1422,7 @@ def compile(
@overload
def compile(
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
filename: str | ReadableBuffer | PathLike[Any],
filename: str | bytes | PathLike[Any],
mode: str,
flags: Literal[1024],
dont_inherit: bool = False,
Expand All @@ -1433,7 +1433,7 @@ def compile(
@overload
def compile(
source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive,
filename: str | ReadableBuffer | PathLike[Any],
filename: str | bytes | PathLike[Any],
mode: str,
flags: int,
dont_inherit: bool = False,
Expand Down
2 changes: 1 addition & 1 deletion stdlib/importlib/abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class InspectLoader(Loader):
def exec_module(self, module: types.ModuleType) -> None: ...
@staticmethod
def source_to_code(
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath = "<string>"
data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: bytes | StrPath = "<string>"
) -> types.CodeType: ...

class ExecutionLoader(InspectLoader):
Expand Down
Loading