diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index f63e06063a31..a591ac876520 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -113,6 +113,8 @@ urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to xml.etree.ElementTree.Element.__bool__ # Doesn't really exist; see comments in stub xml.etree.cElementTree.Element.__bool__ # Doesn't really exist; see comments in stub +platform.platform # runtime default is 0, we pretend it's a bool + # ======= # <= 3.12 diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index 917b4c331ec4..b8af94275410 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -76,6 +76,8 @@ urllib.request.HTTPPasswordMgrWithPriorAuth.__init__ # Args are passed as is to xml.etree.ElementTree.Element.__bool__ # Doesn't really exist; see comments in stub xml.etree.cElementTree.Element.__bool__ # Doesn't really exist; see comments in stub +platform.platform # runtime default is 0, we pretend it's a bool + # ======= # <= 3.12 diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt index 8bc88665e715..e0c0886eadbb 100644 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ b/stdlib/@tests/stubtest_allowlists/py39.txt @@ -193,7 +193,6 @@ sqlite3\.test\..+ # Modules that exist at runtime, but shouldn't be added to ty tkinter.EventType.__new__ # Derives from (str, Enum) types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime - # ============================================================= # Allowlist entries that cannot or should not be fixed; <= 3.11 # ============================================================= @@ -222,6 +221,7 @@ typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ unittest.test # Modules that exist at runtime, but shouldn't be added to typeshed unittest\.test\..+ # Modules that exist at runtime, but shouldn't be added to typeshed +platform.platform # runtime default is 0, we pretend it's a bool # ============================================================= # Allowlist entries that cannot or should not be fixed; <= 3.12 diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index 873f6ac81ebf..852657448be8 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -394,8 +394,8 @@ class window: # undocumented def attroff(self, attr: int, /) -> None: ... def attron(self, attr: int, /) -> None: ... def attrset(self, attr: int, /) -> None: ... - def bkgd(self, ch: _ChType, attr: int = ..., /) -> None: ... - def bkgdset(self, ch: _ChType, attr: int = ..., /) -> None: ... + def bkgd(self, ch: _ChType, attr: int = 0, /) -> None: ... + def bkgdset(self, ch: _ChType, attr: int = 0, /) -> None: ... def border( self, ls: _ChType = ..., @@ -433,7 +433,7 @@ class window: # undocumented def derwin(self, begin_y: int, begin_x: int) -> window: ... @overload def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ... - def echochar(self, ch: _ChType, attr: int = ..., /) -> None: ... + def echochar(self, ch: _ChType, attr: int = 0, /) -> None: ... def enclose(self, y: int, x: int, /) -> bool: ... def erase(self) -> None: ... def getbegyx(self) -> tuple[int, int]: ... diff --git a/stdlib/asyncio/runners.pyi b/stdlib/asyncio/runners.pyi index caf5e4996cf4..919e6521f8a1 100644 --- a/stdlib/asyncio/runners.pyi +++ b/stdlib/asyncio/runners.pyi @@ -26,7 +26,7 @@ if sys.version_info >= (3, 11): if sys.version_info >= (3, 12): def run( - main: Coroutine[Any, Any, _T], *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ... + main: Coroutine[Any, Any, _T], *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None ) -> _T: ... else: diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 978b091cfcdc..c195c2aa21ec 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -1150,8 +1150,8 @@ if sys.platform != "win32": in_fd: FileDescriptor, offset: int, count: int, - headers: Sequence[ReadableBuffer] = ..., - trailers: Sequence[ReadableBuffer] = ..., + headers: Sequence[ReadableBuffer] = (), + trailers: Sequence[ReadableBuffer] = (), flags: int = 0, ) -> int: ... # FreeBSD and Mac OS X only diff --git a/stdlib/pathlib/__init__.pyi b/stdlib/pathlib/__init__.pyi index 4858f8db1ed0..084b4fbce599 100644 --- a/stdlib/pathlib/__init__.pyi +++ b/stdlib/pathlib/__init__.pyi @@ -307,7 +307,7 @@ class Path(PurePath): def link_to(self, target: StrOrBytesPath) -> None: ... if sys.version_info >= (3, 12): def walk( - self, top_down: bool = ..., on_error: Callable[[OSError], object] | None = ..., follow_symlinks: bool = ... + self, top_down: bool = True, on_error: Callable[[OSError], object] | None = None, follow_symlinks: bool = False ) -> Iterator[tuple[Self, list[str], list[str]]]: ... class PosixPath(Path, PurePosixPath): ... diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index c6125bd3a56f..a45d1d1186b6 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -68,7 +68,7 @@ def python_branch() -> str: ... def python_revision() -> str: ... def python_build() -> tuple[str, str]: ... def python_compiler() -> str: ... -def platform(aliased: bool = ..., terse: bool = ...) -> str: ... +def platform(aliased: bool = False, terse: bool = False) -> str: ... if sys.version_info >= (3, 10): def freedesktop_os_release() -> dict[str, str]: ... diff --git a/stdlib/sre_parse.pyi b/stdlib/sre_parse.pyi index 7a80b17c25ac..eaacbff312a9 100644 --- a/stdlib/sre_parse.pyi +++ b/stdlib/sre_parse.pyi @@ -39,7 +39,7 @@ class State: lookbehindgroups: int | None @property def groups(self) -> int: ... - def opengroup(self, name: str | None = ...) -> int: ... + def opengroup(self, name: str | None = None) -> int: ... def closegroup(self, gid: int, p: SubPattern) -> None: ... def checkgroup(self, gid: int) -> bool: ... def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 4e394409bbe0..c85bcd3ad8f0 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -656,7 +656,7 @@ class TarFile: members: Iterable[TarInfo] | None = None, *, numeric_owner: bool = False, - filter: _TarfileFilter | None = ..., + filter: _TarfileFilter | None = None, ) -> None: ... # Same situation as for `extractall`. def extract( @@ -666,7 +666,7 @@ class TarFile: set_attrs: bool = True, *, numeric_owner: bool = False, - filter: _TarfileFilter | None = ..., + filter: _TarfileFilter | None = None, ) -> None: ... def _extract_member( self, diff --git a/stdlib/tkinter/messagebox.pyi b/stdlib/tkinter/messagebox.pyi index 8e5a88f92ea1..cd95f0de5f80 100644 --- a/stdlib/tkinter/messagebox.pyi +++ b/stdlib/tkinter/messagebox.pyi @@ -30,7 +30,7 @@ def showinfo( *, detail: str = ..., icon: Literal["error", "info", "question", "warning"] = ..., - default: Literal["ok"] = ..., + default: Literal["ok"] = "ok", parent: Misc = ..., ) -> str: ... def showwarning( @@ -39,7 +39,7 @@ def showwarning( *, detail: str = ..., icon: Literal["error", "info", "question", "warning"] = ..., - default: Literal["ok"] = ..., + default: Literal["ok"] = "ok", parent: Misc = ..., ) -> str: ... def showerror( @@ -48,7 +48,7 @@ def showerror( *, detail: str = ..., icon: Literal["error", "info", "question", "warning"] = ..., - default: Literal["ok"] = ..., + default: Literal["ok"] = "ok", parent: Misc = ..., ) -> str: ... def askquestion( diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 6b0941a91719..0a6435feb186 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -329,7 +329,7 @@ class _patcher: create: bool = ..., spec_set: Any | None = ..., autospec: Any | None = ..., - new_callable: None = ..., + new_callable: None = None, **kwargs: Any, ) -> _patch_pass_arg[MagicMock | AsyncMock]: ... @overload @@ -368,7 +368,7 @@ class _patcher: create: bool = ..., spec_set: Any | None = ..., autospec: Any | None = ..., - new_callable: None = ..., + new_callable: None = None, **kwargs: Any, ) -> _patch_pass_arg[MagicMock | AsyncMock]: ... @staticmethod diff --git a/stdlib/zipfile/__init__.pyi b/stdlib/zipfile/__init__.pyi index 73e3a92fd0e2..1331df3365d1 100644 --- a/stdlib/zipfile/__init__.pyi +++ b/stdlib/zipfile/__init__.pyi @@ -161,7 +161,7 @@ class ZipFile: def __init__( self, file: StrPath | _ZipWritable, - mode: Literal["w", "x"] = ..., + mode: Literal["w", "x"], compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -173,7 +173,7 @@ class ZipFile: def __init__( self, file: StrPath | _ZipReadableTellable, - mode: Literal["a"] = ..., + mode: Literal["a"], compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -208,7 +208,7 @@ class ZipFile: def __init__( self, file: StrPath | _ZipWritable, - mode: Literal["w", "x"] = ..., + mode: Literal["w", "x"], compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -219,7 +219,7 @@ class ZipFile: def __init__( self, file: StrPath | _ZipReadableTellable, - mode: Literal["a"] = ..., + mode: Literal["a"], compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, diff --git a/stdlib/zipfile/_path/glob.pyi b/stdlib/zipfile/_path/glob.pyi index f25ae71725c0..f6a661be8cdf 100644 --- a/stdlib/zipfile/_path/glob.pyi +++ b/stdlib/zipfile/_path/glob.pyi @@ -4,7 +4,11 @@ from re import Match if sys.version_info >= (3, 13): class Translator: - def __init__(self, seps: str = ...) -> None: ... + if sys.platform == "win32": + def __init__(self, seps: str = "\\/") -> None: ... + else: + def __init__(self, seps: str = "/") -> None: ... + def translate(self, pattern: str) -> str: ... def extend(self, pattern: str) -> str: ... def match_dirs(self, pattern: str) -> str: ...