From 53747b264e490c3dc19b40175115e2ac05bb5f55 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 7 Feb 2023 12:00:40 +0000 Subject: [PATCH] Stdlib: add 'obvious' default values (#9688) --- stdlib/asyncio/events.pyi | 20 ++++----- stdlib/asyncio/subprocess.pyi | 60 +++++++++++++------------- stdlib/builtins.pyi | 22 +++++----- stdlib/functools.pyi | 4 +- stdlib/importlib/abc.pyi | 22 +++++----- stdlib/importlib/metadata/__init__.pyi | 4 +- stdlib/itertools.pyi | 4 +- stdlib/multiprocessing/managers.pyi | 2 +- stdlib/os/__init__.pyi | 20 ++++----- stdlib/re.pyi | 2 +- stdlib/signal.pyi | 2 +- stdlib/smtplib.pyi | 2 +- stdlib/sqlite3/dbapi2.pyi | 2 +- stdlib/subprocess.pyi | 32 +++++++------- stdlib/types.pyi | 6 +-- stdlib/typing.pyi | 2 +- stdlib/typing_extensions.pyi | 2 +- 17 files changed, 104 insertions(+), 104 deletions(-) diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index b2292801e..92e455a25 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -524,11 +524,11 @@ class AbstractEventLoop: stdin: int | IO[Any] | None = -1, stdout: int | IO[Any] | None = -1, stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, text: Literal[False, None] = ..., **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... @@ -541,11 +541,11 @@ class AbstractEventLoop: stdin: int | IO[Any] | None = -1, stdout: int | IO[Any] | None = -1, stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = ..., - shell: Literal[False] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[False] = False, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, **kwargs: Any, ) -> tuple[SubprocessTransport, _ProtocolT]: ... @abstractmethod diff --git a/stdlib/asyncio/subprocess.pyi b/stdlib/asyncio/subprocess.pyi index b112a9d80..10a414f24 100644 --- a/stdlib/asyncio/subprocess.pyi +++ b/stdlib/asyncio/subprocess.pyi @@ -49,11 +49,11 @@ if sys.version_info >= (3, 11): limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, text: Literal[False, None] = ..., # These parameters are taken by subprocess.Popen, which this ultimately delegates to executable: StrOrBytesPath | None = ..., @@ -81,11 +81,11 @@ if sys.version_info >= (3, 11): stderr: int | IO[Any] | None = None, limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to text: bool | None = ..., executable: StrOrBytesPath | None = ..., @@ -115,11 +115,11 @@ elif sys.version_info >= (3, 10): limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, text: Literal[False, None] = ..., # These parameters are taken by subprocess.Popen, which this ultimately delegates to executable: StrOrBytesPath | None = ..., @@ -146,11 +146,11 @@ elif sys.version_info >= (3, 10): stderr: int | IO[Any] | None = None, limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to text: bool | None = ..., executable: StrOrBytesPath | None = ..., @@ -180,11 +180,11 @@ else: # >= 3.9 limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, text: Literal[False, None] = ..., # These parameters are taken by subprocess.Popen, which this ultimately delegates to executable: StrOrBytesPath | None = ..., @@ -211,11 +211,11 @@ else: # >= 3.9 loop: events.AbstractEventLoop | None = None, limit: int = 65536, # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = ..., - shell: Literal[True] = ..., - bufsize: Literal[0] = ..., - encoding: None = ..., - errors: None = ..., + universal_newlines: Literal[False] = False, + shell: Literal[True] = True, + bufsize: Literal[0] = 0, + encoding: None = None, + errors: None = None, # These parameters are taken by subprocess.Popen, which this ultimately delegates to text: bool | None = ..., executable: StrOrBytesPath | None = ..., diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 70c4dff62..1d3bb6abd 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -257,13 +257,13 @@ class int: @overload def __pow__(self, __x: Literal[0], __modulo: None) -> Literal[1]: ... @overload - def __pow__(self, __x: _PositiveInteger, __modulo: None = ...) -> int: ... + def __pow__(self, __x: _PositiveInteger, __modulo: None = None) -> int: ... @overload - def __pow__(self, __x: _NegativeInteger, __modulo: None = ...) -> float: ... + def __pow__(self, __x: _NegativeInteger, __modulo: None = None) -> float: ... # positive x -> int; negative x -> float # return type must be Any as `int | float` causes too many false-positive errors @overload - def __pow__(self, __x: int, __modulo: None = ...) -> Any: ... + def __pow__(self, __x: int, __modulo: None = None) -> Any: ... @overload def __pow__(self, __x: int, __modulo: int) -> int: ... def __rpow__(self, __x: int, __mod: int | None = None) -> Any: ... @@ -330,7 +330,7 @@ class float: def __rmod__(self, __x: float) -> float: ... def __rdivmod__(self, __x: float) -> tuple[float, float]: ... @overload - def __rpow__(self, __x: _PositiveInteger, __modulo: None = ...) -> float: ... + def __rpow__(self, __x: _PositiveInteger, __modulo: None = None) -> float: ... @overload def __rpow__(self, __x: _NegativeInteger, __mod: None = None) -> complex: ... # Returning `complex` for the general case gives too many false-positive errors. @@ -1450,30 +1450,30 @@ class map(Iterator[_S], Generic[_S]): @overload def max( - __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = None ) -> SupportsRichComparisonT: ... @overload def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None) -> SupportsRichComparisonT: ... @overload def max(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... +def max(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... @overload def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload def min( - __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = ... + __arg1: SupportsRichComparisonT, __arg2: SupportsRichComparisonT, *_args: SupportsRichComparisonT, key: None = None ) -> SupportsRichComparisonT: ... @overload def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ...) -> SupportsRichComparisonT: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None) -> SupportsRichComparisonT: ... @overload def min(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... @overload -def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T: ... +def min(__iterable: Iterable[SupportsRichComparisonT], *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... @overload def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... @overload @@ -1595,7 +1595,7 @@ class _SupportsPow2(Protocol[_E, _T_co]): def __pow__(self, __other: _E) -> _T_co: ... class _SupportsPow3NoneOnly(Protocol[_E, _T_co]): - def __pow__(self, __other: _E, __modulo: None = ...) -> _T_co: ... + def __pow__(self, __other: _E, __modulo: None = None) -> _T_co: ... class _SupportsPow3(Protocol[_E, _M, _T_co]): def __pow__(self, __other: _E, __modulo: _M) -> _T_co: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 877879814..1a7391d8c 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -111,11 +111,11 @@ class _SingleDispatchCallable(Generic[_T]): # @fun.register(complex) # def _(arg, verbose=False): ... @overload - def register(self, cls: type[Any], func: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register(self, cls: type[Any], func: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... # @fun.register # def _(arg: int, verbose=False): @overload - def register(self, cls: Callable[..., _T], func: None = ...) -> Callable[..., _T]: ... + def register(self, cls: Callable[..., _T], func: None = None) -> Callable[..., _T]: ... # fun.register(int, lambda x: x) @overload def register(self, cls: type[Any], func: Callable[..., _T]) -> Callable[..., _T]: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index 78b79267d..3d0c2d38c 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -133,7 +133,7 @@ if sys.version_info >= (3, 9): @overload @abstractmethod def open( - self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @overload @@ -142,9 +142,9 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeUpdating, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedRandom: ... @overload @abstractmethod @@ -152,9 +152,9 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeWriting, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedWriter: ... @overload @abstractmethod @@ -162,15 +162,15 @@ if sys.version_info >= (3, 9): self, mode: OpenBinaryModeReading, buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload @abstractmethod def open( - self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = None, errors: None = None, newline: None = None ) -> BinaryIO: ... # Fallback if mode is not specified @overload diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index cc93aaeca..8c4ee3774 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -132,7 +132,7 @@ class Distribution: @overload @classmethod def discover( - cls, *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any + cls, *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any ) -> Iterable[Distribution]: ... @staticmethod def at(path: StrPath) -> PathDistribution: ... @@ -185,7 +185,7 @@ def distribution(distribution_name: str) -> Distribution: ... def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ... @overload def distributions( - *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any + *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any ) -> Iterable[Distribution]: ... if sys.version_info >= (3, 10): diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index a16827a3a..bea946376 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -51,7 +51,7 @@ class repeat(Iterator[_T], Generic[_T]): class accumulate(Iterator[_T], Generic[_T]): if sys.version_info >= (3, 8): @overload - def __init__(self, iterable: Iterable[_T], func: None = ..., *, initial: _T | None = ...) -> None: ... + def __init__(self, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> None: ... @overload def __init__(self, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> None: ... else: @@ -87,7 +87,7 @@ class filterfalse(Iterator[_T], Generic[_T]): class groupby(Iterator[tuple[_T, Iterator[_S]]], Generic[_T, _S]): @overload - def __new__(cls, iterable: Iterable[_T1], key: None = ...) -> groupby[_T1, _T1]: ... + def __new__(cls, iterable: Iterable[_T1], key: None = None) -> groupby[_T1, _T1]: ... @overload def __new__(cls, iterable: Iterable[_T1], key: Callable[[_T1], _T2]) -> groupby[_T2, _T1]: ... def __iter__(self: Self) -> Self: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 1696714d1..baeabab94 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -111,7 +111,7 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload - def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = None, reverse: bool = ...) -> None: ... @overload def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index b1b9db9ae..23c167c45 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -530,8 +530,8 @@ def fdopen( mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, - errors: None = ..., - newline: None = ..., + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> FileIO: ... @@ -541,8 +541,8 @@ def fdopen( mode: OpenBinaryModeUpdating, buffering: Literal[-1, 1] = -1, encoding: None = None, - errors: None = ..., - newline: None = ..., + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedRandom: ... @@ -552,8 +552,8 @@ def fdopen( mode: OpenBinaryModeWriting, buffering: Literal[-1, 1] = -1, encoding: None = None, - errors: None = ..., - newline: None = ..., + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedWriter: ... @@ -563,8 +563,8 @@ def fdopen( mode: OpenBinaryModeReading, buffering: Literal[-1, 1] = -1, encoding: None = None, - errors: None = ..., - newline: None = ..., + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BufferedReader: ... @@ -574,8 +574,8 @@ def fdopen( mode: OpenBinaryMode, buffering: int = -1, encoding: None = None, - errors: None = ..., - newline: None = ..., + errors: None = None, + newline: None = None, closefd: bool = ..., opener: _Opener | None = ..., ) -> BinaryIO: ... diff --git a/stdlib/re.pyi b/stdlib/re.pyi index f45ac7383..4e53141ad 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -72,7 +72,7 @@ class Match(Generic[AnyStr]): def expand(self, template: AnyStr) -> AnyStr: ... # group() returns "AnyStr" or "AnyStr | None", depending on the pattern. @overload - def group(self, __group: Literal[0] = ...) -> AnyStr: ... + def group(self, __group: Literal[0] = 0) -> AnyStr: ... @overload def group(self, __group: str | int) -> AnyStr | Any: ... @overload diff --git a/stdlib/signal.pyi b/stdlib/signal.pyi index 29481119b..e411d4701 100644 --- a/stdlib/signal.pyi +++ b/stdlib/signal.pyi @@ -178,4 +178,4 @@ def set_wakeup_fd(fd: int, *, warn_on_full_buffer: bool = ...) -> int: ... if sys.version_info >= (3, 9): if sys.platform == "linux": - def pidfd_send_signal(__pidfd: int, __sig: int, __siginfo: None = ..., __flags: int = ...) -> None: ... + def pidfd_send_signal(__pidfd: int, __sig: int, __siginfo: None = None, __flags: int = ...) -> None: ... diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index d0d674242..63082f69d 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -68,7 +68,7 @@ def quotedata(data: str) -> str: ... class _AuthObject(Protocol): @overload - def __call__(self, challenge: None = ...) -> str | None: ... + def __call__(self, challenge: None = None) -> str | None: ... @overload def __call__(self, challenge: bytes) -> str: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index 01274d6e2..5111a2de9 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -324,7 +324,7 @@ class Connection: def create_function(self, name: str, num_params: int, func: Callable[..., _SqliteData] | None) -> None: ... @overload - def cursor(self, cursorClass: None = ...) -> Cursor: ... + def cursor(self, cursorClass: None = None) -> Cursor: ... @overload def cursor(self, cursorClass: Callable[[], _CursorT]) -> _CursorT: ... def execute(self, sql: str, parameters: _Parameters = ...) -> Cursor: ... diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index 35a7b7e34..bda422d2e 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -257,8 +257,8 @@ if sys.version_info >= (3, 11): *, capture_output: bool = False, check: bool = False, - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, input: ReadableBuffer | None = None, text: Literal[None, False] = ..., timeout: float | None = None, @@ -461,8 +461,8 @@ elif sys.version_info >= (3, 10): *, capture_output: bool = False, check: bool = False, - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, input: ReadableBuffer | None = None, text: Literal[None, False] = ..., timeout: float | None = None, @@ -659,8 +659,8 @@ elif sys.version_info >= (3, 9): *, capture_output: bool = False, check: bool = False, - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, input: ReadableBuffer | None = None, text: Literal[None, False] = ..., timeout: float | None = None, @@ -838,8 +838,8 @@ else: *, capture_output: bool = False, check: bool = False, - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, input: ReadableBuffer | None = None, text: Literal[None, False] = ..., timeout: float | None = None, @@ -1251,8 +1251,8 @@ if sys.version_info >= (3, 11): *, timeout: float | None = None, input: _InputString | None = ..., - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, text: Literal[None, False] = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -1437,8 +1437,8 @@ elif sys.version_info >= (3, 10): *, timeout: float | None = None, input: _InputString | None = ..., - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, text: Literal[None, False] = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -1617,8 +1617,8 @@ elif sys.version_info >= (3, 9): *, timeout: float | None = None, input: _InputString | None = ..., - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, text: Literal[None, False] = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -1778,8 +1778,8 @@ else: *, timeout: float | None = None, input: _InputString | None = ..., - encoding: None = ..., - errors: None = ..., + encoding: None = None, + errors: None = None, text: Literal[None, False] = ..., ) -> bytes: ... @overload diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 5fb241066..d529b3d9a 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -363,7 +363,7 @@ class GeneratorType(Generator[_T_co, _T_contra, _V_co]): self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... @final class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]): @@ -379,7 +379,7 @@ class AsyncGeneratorType(AsyncGenerator[_T_co, _T_contra]): self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - async def athrow(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + async def athrow(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... def aclose(self) -> Coroutine[Any, Any, None]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, __item: Any) -> GenericAlias: ... @@ -402,7 +402,7 @@ class CoroutineType(Coroutine[_T_co, _T_contra, _V_co]): self, __typ: type[BaseException], __val: BaseException | object = ..., __tb: TracebackType | None = ... ) -> _T_co: ... @overload - def throw(self, __typ: BaseException, __val: None = ..., __tb: TracebackType | None = ...) -> _T_co: ... + def throw(self, __typ: BaseException, __val: None = None, __tb: TracebackType | None = ...) -> _T_co: ... class _StaticFunctionType: # Fictional type to correct the type of MethodType.__func__. diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index c2b9e2154..408c277cf 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -784,7 +784,7 @@ class NamedTuple(tuple[Any, ...]): @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ... @overload - def __init__(self, typename: str, fields: None = ..., **kwargs: Any) -> None: ... + def __init__(self, typename: str, fields: None = None, **kwargs: Any) -> None: ... @classmethod def _make(cls: Type[_T], iterable: Iterable[Any]) -> _T: ... if sys.version_info >= (3, 8): diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 73a41f166..8ba91e539 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -242,7 +242,7 @@ else: @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ... @overload - def __init__(self, typename: str, fields: None = ..., **kwargs: Any) -> None: ... + def __init__(self, typename: str, fields: None = None, **kwargs: Any) -> None: ... @classmethod def _make(cls: type[_typeshed.Self], iterable: Iterable[Any]) -> _typeshed.Self: ... if sys.version_info >= (3, 8):