From 6011cac0cc34b003ce029ae079306db8b8ee7f5f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 30 Jan 2023 05:40:56 +0000 Subject: [PATCH] Stdlib: fix three trivial issues with parameter defaults (#9618) --- stdlib/_dummy_threading.pyi | 2 +- stdlib/gettext.pyi | 4 +++- stdlib/mailbox.pyi | 2 +- tests/stubtest_allowlists/py37.txt | 1 - tests/stubtest_allowlists/py38.txt | 1 - 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index 3a6e998f7..9a49dfa96 100644 --- a/stdlib/_dummy_threading.pyi +++ b/stdlib/_dummy_threading.pyi @@ -41,7 +41,7 @@ def enumerate() -> list[Thread]: ... def main_thread() -> Thread: ... def settrace(func: TraceFunction) -> None: ... def setprofile(func: ProfileFunction | None) -> None: ... -def stack_size(size: int = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... TIMEOUT_MAX: float diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index c31a36f73..5d98227ec 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -63,9 +63,11 @@ def find( # type: ignore[misc] ) -> str | None: ... @overload def find( - domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[True] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, *, all: Literal[True] ) -> list[str]: ... @overload +def find(domain: str, localedir: StrPath | None, languages: Iterable[str] | None, all: Literal[True]) -> list[str]: ... +@overload def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... _NullTranslationsT = TypeVar("_NullTranslationsT", bound=NullTranslations) diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 21e2b4f77..7d667dd09 100644 --- a/stdlib/mailbox.pyi +++ b/stdlib/mailbox.pyi @@ -90,7 +90,7 @@ class Mailbox(Generic[_MessageT]): @overload def pop(self, key: str, default: None = None) -> _MessageT | None: ... @overload - def pop(self, key: str, default: _T = ...) -> _MessageT | _T: ... + def pop(self, key: str, default: _T) -> _MessageT | _T: ... def popitem(self) -> tuple[str, _MessageT]: ... def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = None) -> None: ... @abstractmethod diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 27209691f..480d47fc3 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -83,7 +83,6 @@ distutils.core.gen_usage distutils.core.setup_keywords dummy_threading.Lock dummy_threading.RLock -dummy_threading.stack_size html.parser.HTMLParser.unescape platform.popen plistlib.Data.asBase64 diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index ea44eb240..b8377089c 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -102,7 +102,6 @@ distutils.fancy_getopt.neg_alias_re dummy_threading.ExceptHookArgs dummy_threading.Lock dummy_threading.RLock -dummy_threading.stack_size html.parser.HTMLParser.unescape multiprocessing.managers.SharedMemoryServer.create multiprocessing.managers.SharedMemoryServer.list_segments