From 17954890d9495dd39e7b53f97bc9f1ec186ae474 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Jan 2023 23:49:28 +0000 Subject: [PATCH 01/13] 3.10 branches --- stdlib/_bisect.pyi | 32 +- stdlib/_codecs.pyi | 16 +- stdlib/_decimal.pyi | 2 +- stdlib/_warnings.pyi | 4 +- stdlib/_weakrefset.pyi | 2 +- stdlib/_winapi.pyi | 6 +- stdlib/aifc.pyi | 2 +- stdlib/argparse.pyi | 18 +- stdlib/ast.pyi | 40 +- stdlib/asyncio/base_events.pyi | 110 +++--- stdlib/asyncio/events.pyi | 116 +++--- stdlib/asyncio/locks.pyi | 4 +- stdlib/asyncio/queues.pyi | 2 +- stdlib/asyncio/sslproto.pyi | 18 +- stdlib/asyncio/subprocess.pyi | 16 +- stdlib/asyncio/tasks.pyi | 22 +- stdlib/asyncio/windows_events.pyi | 14 +- stdlib/asyncio/windows_utils.pyi | 8 +- stdlib/asyncore.pyi | 6 +- stdlib/builtins.pyi | 144 +++---- stdlib/bz2.pyi | 66 ++-- stdlib/cmath.pyi | 2 +- stdlib/collections/__init__.pyi | 8 +- stdlib/concurrent/futures/process.pyi | 10 +- stdlib/configparser.pyi | 48 +-- stdlib/contextlib.pyi | 2 +- stdlib/csv.pyi | 14 +- stdlib/ctypes/__init__.pyi | 4 +- stdlib/dataclasses.pyi | 68 ++-- stdlib/difflib.pyi | 16 +- stdlib/dis.pyi | 12 +- stdlib/distutils/fancy_getopt.pyi | 2 +- stdlib/distutils/filelist.pyi | 18 +- stdlib/email/feedparser.pyi | 4 +- stdlib/email/message.pyi | 14 +- stdlib/enum.pyi | 10 +- stdlib/fileinput.pyi | 76 ++-- stdlib/fractions.pyi | 6 +- stdlib/functools.pyi | 12 +- stdlib/gettext.pyi | 34 +- stdlib/glob.pyi | 4 +- stdlib/graphlib.pyi | 2 +- stdlib/gzip.pyi | 68 ++-- stdlib/imghdr.pyi | 2 +- stdlib/importlib/abc.pyi | 2 +- stdlib/inspect.pyi | 6 +- stdlib/lib2to3/pytree.pyi | 2 +- stdlib/logging/__init__.pyi | 2 +- stdlib/logging/handlers.pyi | 2 +- stdlib/lzma.pyi | 72 ++-- stdlib/mailbox.pyi | 10 +- stdlib/math.pyi | 8 +- stdlib/mimetypes.pyi | 2 +- stdlib/msilib/__init__.pyi | 28 +- stdlib/multiprocessing/connection.pyi | 4 +- stdlib/multiprocessing/context.pyi | 18 +- stdlib/multiprocessing/dummy/connection.pyi | 2 +- stdlib/multiprocessing/heap.pyi | 2 +- stdlib/multiprocessing/managers.pyi | 2 +- stdlib/multiprocessing/popen_spawn_win32.pyi | 2 +- stdlib/multiprocessing/reduction.pyi | 4 +- stdlib/multiprocessing/shared_memory.pyi | 4 +- stdlib/multiprocessing/sharedctypes.pyi | 30 +- stdlib/ntpath.pyi | 4 +- stdlib/numbers.pyi | 2 +- stdlib/optparse.pyi | 4 +- stdlib/os/__init__.pyi | 32 +- stdlib/pathlib.pyi | 40 +- stdlib/posixpath.pyi | 10 +- stdlib/pydoc.pyi | 14 +- stdlib/random.pyi | 6 +- stdlib/re.pyi | 88 ++--- stdlib/shutil.pyi | 24 +- stdlib/smtpd.pyi | 4 +- stdlib/smtplib.pyi | 2 +- stdlib/socket.pyi | 50 +-- stdlib/socketserver.pyi | 2 +- stdlib/sqlite3/dbapi2.pyi | 2 +- stdlib/ssl.pyi | 12 +- stdlib/statistics.pyi | 4 +- stdlib/subprocess.pyi | 342 ++++++++--------- stdlib/sunau.pyi | 2 +- stdlib/sysconfig.pyi | 4 +- stdlib/tarfile.pyi | 20 +- stdlib/tempfile.pyi | 130 +++---- stdlib/tkinter/__init__.pyi | 380 +++++++++---------- stdlib/tkinter/colorchooser.pyi | 2 +- stdlib/tkinter/commondialog.pyi | 2 +- stdlib/tkinter/dialog.pyi | 2 +- stdlib/tkinter/dnd.pyi | 4 +- stdlib/tkinter/filedialog.pyi | 16 +- stdlib/tkinter/font.pyi | 30 +- stdlib/tkinter/messagebox.pyi | 16 +- stdlib/tkinter/scrolledtext.pyi | 2 +- stdlib/tkinter/simpledialog.pyi | 16 +- stdlib/tkinter/tix.pyi | 70 ++-- stdlib/tkinter/ttk.pyi | 162 ++++---- stdlib/traceback.pyi | 32 +- stdlib/turtle.pyi | 164 ++++---- stdlib/types.pyi | 32 +- stdlib/typing.pyi | 2 +- stdlib/typing_extensions.pyi | 20 +- stdlib/unittest/case.pyi | 44 +-- stdlib/unittest/signals.pyi | 2 +- stdlib/urllib/parse.pyi | 18 +- stdlib/warnings.pyi | 6 +- stdlib/wave.pyi | 2 +- stdlib/weakref.pyi | 6 +- stdlib/webbrowser.pyi | 2 +- stdlib/winreg.pyi | 8 +- stdlib/winsound.pyi | 2 +- stdlib/wsgiref/headers.pyi | 2 +- stdlib/xml/etree/ElementTree.pyi | 72 ++-- stdlib/xmlrpc/client.pyi | 2 +- stdlib/zipfile.pyi | 16 +- stdlib/zlib.pyi | 2 +- 116 files changed, 1610 insertions(+), 1610 deletions(-) diff --git a/stdlib/_bisect.pyi b/stdlib/_bisect.pyi index d902e1eea7d4..cb036d904474 100644 --- a/stdlib/_bisect.pyi +++ b/stdlib/_bisect.pyi @@ -8,55 +8,55 @@ _T = TypeVar("_T") if sys.version_info >= (3, 10): @overload def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None, *, key: None = None ) -> int: ... @overload def bisect_left( a: Sequence[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT] = None, ) -> int: ... @overload def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ..., *, key: None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None, *, key: None = None ) -> int: ... @overload def bisect_right( a: Sequence[_T], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = ..., + key: Callable[[_T], SupportsRichComparisonT] = None, ) -> int: ... @overload def insort_left( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_left( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = None ) -> None: ... @overload def insort_right( a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, - lo: int = ..., - hi: int | None = ..., + lo: int = 0, + hi: int | None = None, *, - key: None = ..., + key: None = None, ) -> None: ... @overload def insort_right( - a: MutableSequence[_T], x: _T, lo: int = ..., hi: int | None = ..., *, key: Callable[[_T], SupportsRichComparisonT] = ... + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = None ) -> None: ... else: diff --git a/stdlib/_codecs.pyi b/stdlib/_codecs.pyi index 232256fbf614..f440547613a7 100644 --- a/stdlib/_codecs.pyi +++ b/stdlib/_codecs.pyi @@ -45,27 +45,27 @@ _BytesToBytesEncoding: TypeAlias = Literal[ _StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"] @overload -def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... +def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = 'strict') -> bytes: ... @overload -def encode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... # type: ignore[misc] +def encode(obj: str, encoding: _StrToStrEncoding, errors: str = 'strict') -> str: ... # type: ignore[misc] @overload -def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ... +def encode(obj: str, encoding: str = 'utf-8', errors: str = 'strict') -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... # type: ignore[misc] +def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = 'strict') -> bytes: ... # type: ignore[misc] @overload -def decode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... +def decode(obj: str, encoding: _StrToStrEncoding, errors: str = 'strict') -> str: ... # these are documented as text encodings but in practice they also accept str as input @overload def decode( - obj: str, encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], errors: str = ... + obj: str, encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], errors: str = 'strict' ) -> str: ... # hex is officially documented as a bytes to bytes encoding, but it appears to also work with str @overload -def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = ...) -> bytes: ... +def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = 'strict') -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: str = ..., errors: str = ...) -> str: ... +def decode(obj: ReadableBuffer, encoding: str = 'utf-8', errors: str = 'strict') -> str: ... def lookup(__encoding: str) -> codecs.CodecInfo: ... def charmap_build(__map: str) -> _CharMap: ... def ascii_decode(__data: ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ... diff --git a/stdlib/_decimal.pyi b/stdlib/_decimal.pyi index c0e6c9882181..5176f4cde9ba 100644 --- a/stdlib/_decimal.pyi +++ b/stdlib/_decimal.pyi @@ -66,7 +66,7 @@ if sys.version_info >= (3, 11): ) -> _ContextManager: ... else: - def localcontext(ctx: Context | None = ...) -> _ContextManager: ... + def localcontext(ctx: Context | None = None) -> _ContextManager: ... class Decimal: def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ... diff --git a/stdlib/_warnings.pyi b/stdlib/_warnings.pyi index 2eb9ae478a5d..0981dfeaafee 100644 --- a/stdlib/_warnings.pyi +++ b/stdlib/_warnings.pyi @@ -5,9 +5,9 @@ _onceregistry: dict[Any, Any] filters: list[tuple[str, str | None, type[Warning], str | None, int]] @overload -def warn(message: str, category: type[Warning] | None = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: str, category: type[Warning] | None = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload -def warn(message: Warning, category: Any = ..., stacklevel: int = ..., source: Any | None = ...) -> None: ... +def warn(message: Warning, category: Any = None, stacklevel: int = 1, source: Any | None = None) -> None: ... @overload def warn_explicit( message: str, diff --git a/stdlib/_weakrefset.pyi b/stdlib/_weakrefset.pyi index da09442e855b..fdf26641bbeb 100644 --- a/stdlib/_weakrefset.pyi +++ b/stdlib/_weakrefset.pyi @@ -13,7 +13,7 @@ _T = TypeVar("_T") class WeakSet(MutableSet[_T], Generic[_T]): @overload - def __init__(self, data: None = ...) -> None: ... + def __init__(self, data: None = None) -> None: ... @overload def __init__(self, data: Iterable[_T]) -> None: ... def add(self, item: _T) -> None: ... diff --git a/stdlib/_winapi.pyi b/stdlib/_winapi.pyi index 4fbefc33abb1..fc56cadf0967 100644 --- a/stdlib/_winapi.pyi +++ b/stdlib/_winapi.pyi @@ -128,7 +128,7 @@ if sys.platform == "win32": @overload def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... @overload - def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ... + def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ... @overload def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ... def CreateFile( @@ -189,7 +189,7 @@ if sys.platform == "win32": @overload def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> tuple[bytes, int]: ... + def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ... @overload def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ... def SetNamedPipeHandleState( @@ -202,7 +202,7 @@ if sys.platform == "win32": @overload def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... @overload - def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = ...) -> tuple[int, int]: ... + def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ... @overload def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ... @final diff --git a/stdlib/aifc.pyi b/stdlib/aifc.pyi index 14e824f3d22e..afb640e04fd7 100644 --- a/stdlib/aifc.pyi +++ b/stdlib/aifc.pyi @@ -81,7 +81,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): @overload diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index 01a3f01b9751..269df8efe255 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -164,7 +164,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): # The type-ignores in these overloads should be temporary. See: # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 @overload - def parse_args(self, args: Sequence[str] | None = ...) -> Namespace: ... + def parse_args(self, args: Sequence[str] | None = None) -> Namespace: ... @overload def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore[misc] @overload @@ -378,10 +378,10 @@ class _StoreConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented @@ -422,10 +422,10 @@ class _AppendConstAction(Action): option_strings: Sequence[str], dest: str, const: Any, - default: Any = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., + default: Any = None, + required: bool = False, + help: str | None = None, + metavar: str | tuple[str, ...] | None = None, ) -> None: ... # undocumented diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index ad14c643fe9e..53df5025f255 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -174,11 +174,11 @@ if sys.version_info >= (3, 8): @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = ..., - mode: Literal["exec"] = ..., + filename: str | ReadableBuffer | os.PathLike[Any] = '', + mode: Literal["exec"] = 'exec', *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Module: ... @overload def parse( @@ -186,8 +186,8 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["eval"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( @@ -195,8 +195,8 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["func_type"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( @@ -204,41 +204,41 @@ if sys.version_info >= (3, 8): filename: str | ReadableBuffer | os.PathLike[Any], mode: Literal["single"], *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["eval"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Expression: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["func_type"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> FunctionType: ... @overload def parse( source: str | ReadableBuffer, *, mode: Literal["single"], - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> Interactive: ... @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = ..., - mode: str = ..., + filename: str | ReadableBuffer | os.PathLike[Any] = '', + mode: str = 'exec', *, - type_comments: bool = ..., - feature_version: None | int | tuple[int, int] = ..., + type_comments: bool = False, + feature_version: None | int | tuple[int, int] = None, ) -> AST: ... else: diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 8af829d4f4a9..1e8d26952d5a 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -90,7 +90,7 @@ class BaseEventLoop(AbstractEventLoop): self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None, context: Context | None = None ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = ...) -> Task[_T]: ... + def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: object = None) -> Task[_T]: ... else: def create_task(self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T]) -> Task[_T]: ... @@ -156,37 +156,37 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... else: @overload @@ -283,35 +283,35 @@ class BaseEventLoop(AbstractEventLoop): async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., - port: int = ..., + host: str | Sequence[str] | None = None, + port: int = None, *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., - sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, @@ -319,17 +319,17 @@ class BaseEventLoop(AbstractEventLoop): protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> Transport: ... async def connect_accepted_socket( self, protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... async def sock_sendfile( @@ -356,16 +356,16 @@ class BaseEventLoop(AbstractEventLoop): async def create_datagram_endpoint( self, protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | str | None = ..., - remote_addr: tuple[str, int] | str | None = ..., + local_addr: tuple[str, int] | str | None = None, + remote_addr: tuple[str, int] | str | None = None, *, - family: int = ..., - proto: int = ..., - flags: int = ..., + family: int = 0, + proto: int = 0, + flags: int = 0, reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - allow_broadcast: bool | None = ..., - sock: socket | None = ..., + reuse_port: bool | None = None, + allow_broadcast: bool | None = None, + sock: socket | None = None, ) -> tuple[DatagramTransport, _ProtocolT]: ... # Pipes and subprocesses. async def connect_read_pipe( diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index aa209828161e..14db489a0096 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -167,7 +167,7 @@ class AbstractEventLoop: elif sys.version_info >= (3, 8): @abstractmethod def create_task( - self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = ... + self, coro: Coroutine[Any, Any, _T] | Generator[Any, None, _T], *, name: str | None = None ) -> Task[_T]: ... else: @abstractmethod @@ -250,38 +250,38 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... else: @overload @@ -387,36 +387,36 @@ class AbstractEventLoop: async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., - port: int = ..., + host: str | Sequence[str] | None = None, + port: int = None, *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., - sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( @@ -425,20 +425,20 @@ class AbstractEventLoop: protocol: BaseProtocol, sslcontext: ssl.SSLContext, *, - server_side: bool = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> Transport: ... async def create_unix_server( self, protocol_factory: _ProtocolFactory, - path: StrPath | None = ..., + path: StrPath | None = None, *, - sock: socket | None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket | None = None, + backlog: int = 100, + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... if sys.version_info >= (3, 11): async def connect_accepted_socket( @@ -456,8 +456,8 @@ class AbstractEventLoop: protocol_factory: Callable[[], _ProtocolT], sock: socket, *, - ssl: _SSLContext = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): async def create_unix_connection( @@ -475,12 +475,12 @@ class AbstractEventLoop: async def create_unix_connection( self, protocol_factory: Callable[[], _ProtocolT], - path: str | None = ..., + path: str | None = None, *, - ssl: _SSLContext = ..., - sock: socket | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + sock: socket | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @abstractmethod diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index 76aad7be2d46..3e348e8c35e0 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -69,7 +69,7 @@ class Condition(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, lock: Lock | None = None) -> None: ... else: - def __init__(self, lock: Lock | None = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -85,7 +85,7 @@ class Semaphore(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, value: int = 1) -> None: ... else: - def __init__(self, value: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... diff --git a/stdlib/asyncio/queues.pyi b/stdlib/asyncio/queues.pyi index 6c64f6aa4dc2..76273be7588c 100644 --- a/stdlib/asyncio/queues.pyi +++ b/stdlib/asyncio/queues.pyi @@ -16,7 +16,7 @@ class Queue(Generic[_T]): if sys.version_info >= (3, 11): def __init__(self, maxsize: int = 0) -> None: ... else: - def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = ...) -> None: ... def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... diff --git a/stdlib/asyncio/sslproto.pyi b/stdlib/asyncio/sslproto.pyi index cf4761745c8a..b6cf4918b5a3 100644 --- a/stdlib/asyncio/sslproto.pyi +++ b/stdlib/asyncio/sslproto.pyi @@ -48,7 +48,7 @@ if sys.version_info < (3, 11): _need_ssldata: bool _handshake_cb: Callable[[BaseException | None], None] | None _shutdown_cb: Callable[[], None] | None - def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = ...) -> None: ... + def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = None) -> None: ... @property def context(self) -> ssl.SSLContext: ... @property @@ -57,11 +57,11 @@ if sys.version_info < (3, 11): def need_ssldata(self) -> bool: ... @property def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], object] | None = ...) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], object] | None = ...) -> list[bytes]: ... + def do_handshake(self, callback: Callable[[BaseException | None], object] | None = None) -> list[bytes]: ... + def shutdown(self, callback: Callable[[], object] | None = None) -> list[bytes]: ... def feed_eof(self) -> None: ... - def feed_ssldata(self, data: bytes, only_handshake: bool = ...) -> tuple[list[bytes], list[bytes]]: ... - def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ... + def feed_ssldata(self, data: bytes, only_handshake: bool = False) -> tuple[list[bytes], list[bytes]]: ... + def feed_appdata(self, data: bytes, offset: int = 0) -> tuple[list[bytes], int]: ... class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): @@ -131,10 +131,10 @@ class SSLProtocol(_SSLProtocolBase): app_protocol: protocols.BaseProtocol, sslcontext: ssl.SSLContext, waiter: futures.Future[Any], - server_side: bool = ..., - server_hostname: str | None = ..., - call_connection_made: bool = ..., - ssl_handshake_timeout: int | None = ..., + server_side: bool = False, + server_hostname: str | None = None, + call_connection_made: bool = True, + ssl_handshake_timeout: int | None = None, ) -> None: ... def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... diff --git a/stdlib/asyncio/subprocess.pyi b/stdlib/asyncio/subprocess.pyi index 15487c3befc5..690e792efe6f 100644 --- a/stdlib/asyncio/subprocess.pyi +++ b/stdlib/asyncio/subprocess.pyi @@ -109,10 +109,10 @@ if sys.version_info >= (3, 11): elif sys.version_info >= (3, 10): async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., @@ -141,10 +141,10 @@ elif sys.version_info >= (3, 10): async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + 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] = ..., diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 76bc4e2a29e0..114f8cd0e741 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -59,9 +59,9 @@ else: ) -> Iterator[Future[_T]]: ... @overload -def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...) -> _FT: ... # type: ignore[misc] +def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = None) -> _FT: ... # type: ignore[misc] @overload -def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = ...) -> Task[_T]: ... +def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = None) -> Task[_T]: ... # `gather()` actually returns a list with length equal to the number # of tasks passed; however, Tuple is used similar to the annotation for @@ -72,10 +72,10 @@ def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | No # but having overlapping overloads is the only way to get acceptable type inference in all edge cases. if sys.version_info >= (3, 10): @overload - def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = ...) -> Future[tuple[_T1]]: ... # type: ignore[misc] + def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[misc] @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -83,7 +83,7 @@ if sys.version_info >= (3, 10): __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -92,7 +92,7 @@ if sys.version_info >= (3, 10): __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -102,7 +102,7 @@ if sys.version_info >= (3, 10): __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - return_exceptions: Literal[False] = ..., + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather(__coro_or_future1: _FutureLike[_T1], *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[misc] @@ -140,7 +140,7 @@ if sys.version_info >= (3, 10): tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload - def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = ...) -> Future[list[Any]]: ... # type: ignore[misc] + def gather(*coros_or_futures: _FutureLike[Any], return_exceptions: bool = False) -> Future[list[Any]]: ... # type: ignore[misc] else: @overload @@ -243,10 +243,10 @@ if sys.version_info >= (3, 10): @overload async def sleep(delay: float, result: _T) -> _T: ... @overload - async def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] + async def wait(fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = 'ALL_COMPLETED') -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] @overload async def wait( - fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... @@ -309,7 +309,7 @@ if sys.version_info >= (3, 11): ) -> Task[_T]: ... elif sys.version_info >= (3, 8): - def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = ...) -> Task[_T]: ... + def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T], *, name: str | None = None) -> Task[_T]: ... else: def create_task(coro: Generator[Any, None, _T] | Coroutine[Any, Any, _T]) -> Task[_T]: ... diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index dca06ea33b13..ae4f3991ee91 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -33,7 +33,7 @@ if sys.platform == "win32": class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... class ProactorEventLoop(proactor_events.BaseProactorEventLoop): - def __init__(self, proactor: IocpProactor | None = ...) -> None: ... + def __init__(self, proactor: IocpProactor | None = None) -> None: ... async def create_pipe_connection( self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str ) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... @@ -42,13 +42,13 @@ if sys.platform == "win32": ) -> list[PipeServer]: ... class IocpProactor: - def __init__(self, concurrency: int = ...) -> None: ... + def __init__(self, concurrency: int = 4294967295) -> None: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... - def select(self, timeout: int | None = ...) -> list[futures.Future[Any]]: ... - def recv(self, conn: socket.socket, nbytes: int, flags: int = ...) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... - def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = ...) -> futures.Future[Any]: ... + def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ... + def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ... + def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... + def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... def accept(self, listener: socket.socket) -> futures.Future[Any]: ... def connect( self, @@ -58,7 +58,7 @@ if sys.platform == "win32": def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ... - def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = ...) -> bool: ... + def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ... def close(self) -> None: ... SelectorEventLoop = _WindowsSelectorEventLoop diff --git a/stdlib/asyncio/windows_utils.pyi b/stdlib/asyncio/windows_utils.pyi index 6e170dcb073a..6ac4e0d89aa4 100644 --- a/stdlib/asyncio/windows_utils.pyi +++ b/stdlib/asyncio/windows_utils.pyi @@ -16,7 +16,7 @@ if sys.platform == "win32": BUFSIZE: Literal[8192] PIPE = subprocess.PIPE STDOUT = subprocess.STDOUT - def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ... + def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = ..., bufsize: int = 8192) -> tuple[int, int]: ... class PipeHandle: def __init__(self, handle: int) -> None: ... @@ -51,8 +51,8 @@ if sys.platform == "win32": def __init__( self, args: subprocess._CMD, - stdin: subprocess._FILE | None = ..., - stdout: subprocess._FILE | None = ..., - stderr: subprocess._FILE | None = ..., + stdin: subprocess._FILE | None = None, + stdout: subprocess._FILE | None = None, + stderr: subprocess._FILE | None = None, **kwds: Any, ) -> None: ... diff --git a/stdlib/asyncore.pyi b/stdlib/asyncore.pyi index 667f50ad45c6..b287eb28e755 100644 --- a/stdlib/asyncore.pyi +++ b/stdlib/asyncore.pyi @@ -15,12 +15,12 @@ class ExitNow(Exception): ... def read(obj: Any) -> None: ... def write(obj: Any) -> None: ... def readwrite(obj: Any, flags: int) -> None: ... -def poll(timeout: float = ..., map: _MapType | None = None) -> None: ... -def poll2(timeout: float = ..., map: _MapType | None = None) -> None: ... +def poll(timeout: float = 0.0, map: _MapType | None = None) -> None: ... +def poll2(timeout: float = 0.0, map: _MapType | None = None) -> None: ... poll3 = poll2 -def loop(timeout: float = ..., use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... +def loop(timeout: float = 30.0, use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... # Not really subclass of socket.socket; it's only delegation. # It is not covariant to it. diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9a1cfa407a1a..ea38a5ae90fe 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -228,14 +228,14 @@ class int: signed: bool = False, ) -> Self: ... else: - def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = ...) -> bytes: ... + def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: ... @classmethod def from_bytes( cls: type[Self], bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, byteorder: Literal["little", "big"], *, - signed: bool = ..., + signed: bool = False, ) -> Self: ... def __add__(self, __x: int) -> int: ... @@ -432,9 +432,9 @@ class str(Sequence[str]): ) -> bool: ... if sys.version_info >= (3, 8): @overload - def expandtabs(self: LiteralString, tabsize: SupportsIndex = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] else: @overload def expandtabs(self: LiteralString, tabsize: int = ...) -> LiteralString: ... @@ -507,21 +507,21 @@ class str(Sequence[str]): @overload def rpartition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc] @overload - def rsplit(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload def rstrip(self: LiteralString, __chars: LiteralString | None = ...) -> LiteralString: ... @overload def rstrip(self, __chars: str | None = ...) -> str: ... # type: ignore[misc] @overload - def split(self: LiteralString, sep: LiteralString | None = ..., maxsplit: SupportsIndex = ...) -> list[LiteralString]: ... + def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... @overload - def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ... # type: ignore[misc] + def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] @overload - def splitlines(self: LiteralString, keepends: bool = ...) -> list[LiteralString]: ... + def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ... @overload - def splitlines(self, keepends: bool = ...) -> list[str]: ... # type: ignore[misc] + def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc] def startswith( self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ... ) -> bool: ... @@ -976,9 +976,9 @@ class list(MutableSequence[_T], Generic[_T]): # Use list[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload - def sort(self: list[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ...) -> None: ... + def sort(self: list[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... + def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... __hash__: ClassVar[None] # type: ignore[assignment] @@ -1481,13 +1481,13 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def open( file: FileDescriptorOrPath, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + mode: OpenTextMode = 'r', + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @@ -1496,11 +1496,11 @@ def open( file: FileDescriptorOrPath, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> FileIO: ... # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter @@ -1508,34 +1508,34 @@ def open( def open( file: FileDescriptorOrPath, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedRandom: ... @overload def open( file: FileDescriptorOrPath, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedWriter: ... @overload def open( file: FileDescriptorOrPath, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @@ -1543,12 +1543,12 @@ def open( def open( file: FileDescriptorOrPath, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: None = None, + errors: None = None, + newline: None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> BinaryIO: ... # Fallback if mode is not specified @@ -1556,12 +1556,12 @@ def open( def open( file: FileDescriptorOrPath, mode: str, - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, + closefd: bool = True, + opener: _Opener | None = None, ) -> IO[Any]: ... def ord(__c: str | bytes | bytearray) -> int: ... @@ -1603,38 +1603,38 @@ if sys.version_info >= (3, 8): @overload def pow(base: int, exp: int, mod: int) -> int: ... @overload - def pow(base: int, exp: Literal[0], mod: None = ...) -> Literal[1]: ... # type: ignore[misc] + def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ... # type: ignore[misc] @overload - def pow(base: int, exp: _PositiveInteger, mod: None = ...) -> int: ... # type: ignore[misc] + def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ... # type: ignore[misc] @overload - def pow(base: int, exp: _NegativeInteger, mod: None = ...) -> float: ... # type: ignore[misc] + def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ... # type: ignore[misc] # int base & positive-int exp -> int; int base & negative-int exp -> float # return type must be Any as `int | float` causes too many false-positive errors @overload - def pow(base: int, exp: int, mod: None = ...) -> Any: ... + def pow(base: int, exp: int, mod: None = None) -> Any: ... @overload - def pow(base: _PositiveInteger, exp: float, mod: None = ...) -> float: ... + def pow(base: _PositiveInteger, exp: float, mod: None = None) -> float: ... @overload - def pow(base: _NegativeInteger, exp: float, mod: None = ...) -> complex: ... + def pow(base: _NegativeInteger, exp: float, mod: None = None) -> complex: ... @overload - def pow(base: float, exp: int, mod: None = ...) -> float: ... + def pow(base: float, exp: int, mod: None = None) -> float: ... # float base & float exp could return float or complex # return type must be Any (same as complex base, complex exp), # as `float | complex` causes too many false-positive errors @overload - def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> Any: ... + def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> Any: ... @overload - def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = ...) -> complex: ... + def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ... @overload - def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow2[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = ...) -> _T_co: ... + def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = ...) -> _T_co: ... + def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = None) -> _T_co: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = ...) -> Any: ... + def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... @overload - def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = ...) -> complex: ... + def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ... else: @overload @@ -1692,7 +1692,7 @@ class _SupportsRound2(Protocol[_T_co]): def __round__(self, __ndigits: int) -> _T_co: ... @overload -def round(number: _SupportsRound1[_T], ndigits: None = ...) -> _T: ... +def round(number: _SupportsRound1[_T], ndigits: None = None) -> _T: ... @overload def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... @@ -1701,10 +1701,10 @@ def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... def setattr(__obj: object, __name: str, __value: Any) -> None: ... @overload def sorted( - __iterable: Iterable[SupportsRichComparisonT], *, key: None = ..., reverse: bool = ... + __iterable: Iterable[SupportsRichComparisonT], *, key: None = None, reverse: bool = False ) -> list[SupportsRichComparisonT]: ... @overload -def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> list[_T]: ... +def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> list[_T]: ... _AddableT1 = TypeVar("_AddableT1", bound=SupportsAdd[Any, Any]) _AddableT2 = TypeVar("_AddableT2", bound=SupportsAdd[Any, Any]) @@ -1719,7 +1719,7 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit # Instead, we special-case the most common examples of this: bool and literal integers. if sys.version_info >= (3, 8): @overload - def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = ...) -> int: ... # type: ignore[misc] + def sum(__iterable: Iterable[bool | _LiteralInteger], start: int = 0) -> int: ... # type: ignore[misc] else: @overload diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index 39ecc2927a2c..db2602e2671a 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -30,77 +30,77 @@ _WriteTextMode: TypeAlias = Literal["wt", "xt", "at"] @overload def open( filename: _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = 'rb', + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _ReadableFileobj, mode: _ReadTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: _WritableFileobj, mode: _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = 'rb', + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BZ2File: ... @overload def open( filename: StrOrBytesPath, mode: _ReadTextMode | _WriteTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BZ2File | TextIO: ... class BZ2File(BaseStream, IO[bytes]): def __enter__(self: Self) -> Self: ... if sys.version_info >= (3, 9): @overload - def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = 9) -> None: ... @overload - def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., *, compresslevel: int = ...) -> None: ... + def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', *, compresslevel: int = 9) -> None: ... @overload def __init__( - self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = ..., *, compresslevel: int = ... + self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = 'r', *, compresslevel: int = 9 ) -> None: ... else: @overload diff --git a/stdlib/cmath.pyi b/stdlib/cmath.pyi index 30ada5d5b5ef..0a85600e99b7 100644 --- a/stdlib/cmath.pyi +++ b/stdlib/cmath.pyi @@ -27,7 +27,7 @@ def atanh(__z: _C) -> complex: ... def cos(__z: _C) -> complex: ... def cosh(__z: _C) -> complex: ... def exp(__z: _C) -> complex: ... -def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ... +def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ... def isinf(__z: _C) -> bool: ... def isnan(__z: _C) -> bool: ... def log(__x: _C, __y_obj: _C = ...) -> complex: ... diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index dde0f535bbf7..3c6018095c95 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -76,7 +76,7 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> UserDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> UserDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ... @@ -92,7 +92,7 @@ class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]): class UserList(MutableSequence[_T]): data: list[_T] @overload - def __init__(self, initlist: None = ...) -> None: ... + def __init__(self, initlist: None = None) -> None: ... @overload def __init__(self, initlist: Iterable[_T]) -> None: ... def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ... @@ -353,7 +353,7 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]): # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. @classmethod @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = ...) -> OrderedDict[_T, Any | None]: ... + def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]: ... @classmethod @overload def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]: ... @@ -409,7 +409,7 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __contains__(self, key: object) -> bool: ... def __missing__(self, key: _KT) -> _VT: ... # undocumented def __bool__(self) -> bool: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index f3ce4e6d68b8..54c50a328604 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -58,7 +58,7 @@ class _ResultItem: self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None ) -> None: ... else: - def __init__(self, work_id: int, exception: Exception | None = ..., result: Any | None = ...) -> None: ... + def __init__(self, work_id: int, exception: Exception | None = None, result: Any | None = None) -> None: ... class _CallItem: work_id: int @@ -102,7 +102,7 @@ if sys.version_info >= (3, 11): else: def _sendback_result( - result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ... + result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = None, exception: Exception | None = None ) -> None: ... if sys.version_info >= (3, 11): @@ -181,9 +181,9 @@ class ProcessPoolExecutor(Executor): else: def __init__( self, - max_workers: int | None = ..., - mp_context: BaseContext | None = ..., - initializer: Callable[..., object] | None = ..., + max_workers: int | None = None, + mp_context: BaseContext | None = None, + initializer: Callable[..., object] | None = None, initargs: tuple[Any, ...] = ..., ) -> None: ... if sys.version_info >= (3, 9): diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index 89dcaf18ce6e..0538704d5de9 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -65,32 +65,32 @@ class RawConfigParser(_Parser): @overload def __init__( self, - defaults: Mapping[str, str | None] | None = ..., + defaults: Mapping[str, str | None] | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: Literal[True] = ..., + allow_no_value: Literal[True] = False, *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = 'DEFAULT', interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @overload def __init__( self, - defaults: _Section | None = ..., + defaults: _Section | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: bool = ..., + allow_no_value: bool = False, *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., - inline_comment_prefixes: Sequence[str] | None = ..., - strict: bool = ..., - empty_lines_in_values: bool = ..., - default_section: str = ..., + inline_comment_prefixes: Sequence[str] | None = None, + strict: bool = True, + empty_lines_in_values: bool = True, + default_section: str = 'DEFAULT', interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -114,22 +114,22 @@ class RawConfigParser(_Parser): # These get* methods are partially applied (with the same names) in # SectionProxy; the stubs should be kept updated together @overload - def getint(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> int: ... + def getint(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ... @overload def getint( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> int | _T: ... @overload - def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> float: ... + def getfloat(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ... @overload def getfloat( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> float | _T: ... @overload - def getboolean(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> bool: ... + def getboolean(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ... @overload def getboolean( - self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T = ... + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... ) -> bool | _T: ... def _get_conv( self, @@ -143,13 +143,13 @@ class RawConfigParser(_Parser): ) -> _T: ... # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str | Any: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str | Any: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T | Any: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T) -> str | _T | Any: ... @overload - def items(self, *, raw: bool = ..., vars: _Section | None = ...) -> ItemsView[str, SectionProxy]: ... + def items(self, *, raw: bool = False, vars: _Section | None = None) -> ItemsView[str, SectionProxy]: ... @overload - def items(self, section: str, raw: bool = ..., vars: _Section | None = ...) -> list[tuple[str, str]]: ... + def items(self, section: str, raw: bool = False, vars: _Section | None = None) -> list[tuple[str, str]]: ... def set(self, section: str, option: str, value: str | None = None) -> None: ... def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = True) -> None: ... def remove_option(self, section: str, option: str) -> bool: ... @@ -159,9 +159,9 @@ class RawConfigParser(_Parser): class ConfigParser(RawConfigParser): # This is incompatible with MutableMapping so we ignore the type @overload # type: ignore[override] - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> str: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str: ... @overload - def get(self, section: str, option: str, *, raw: bool = ..., vars: _Section | None = ..., fallback: _T) -> str | _T: ... + def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T) -> str | _T: ... if sys.version_info < (3, 12): class SafeConfigParser(ConfigParser): ... # deprecated alias diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index bc32ce0ffac5..440347d99fc3 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -174,7 +174,7 @@ if sys.version_info >= (3, 10): class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index 5a72648a3d20..f6811b58376e 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -76,9 +76,9 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): self, f: Iterable[str], fieldnames: Sequence[_T], - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = 'excel', *, delimiter: str = ..., quotechar: str | None = ..., @@ -93,10 +93,10 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): def __init__( self: DictReader[str], f: Iterable[str], - fieldnames: Sequence[str] | None = ..., - restkey: str | None = ..., - restval: str | None = ..., - dialect: _DialectLike = ..., + fieldnames: Sequence[str] | None = None, + restkey: str | None = None, + restval: str | None = None, + dialect: _DialectLike = 'excel', *, delimiter: str = ..., quotechar: str | None = ..., diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index f3ffd3ec402e..c217bc3952c2 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -25,7 +25,7 @@ class CDLL: def __init__( self, name: str | None, - mode: int = ..., + mode: int = 0, handle: int | None = None, use_errno: bool = False, use_last_error: bool = False, @@ -181,7 +181,7 @@ def sizeof(obj_or_type: _CData | type[_CData]) -> int: ... def string_at(address: _CVoidConstPLike, size: int = -1) -> bytes: ... if sys.platform == "win32": - def WinError(code: int | None = ..., descr: str | None = ...) -> OSError: ... + def WinError(code: int | None = None, descr: str | None = None) -> OSError: ... def wstring_at(address: _CVoidConstPLike, size: int = -1) -> str: ... diff --git a/stdlib/dataclasses.pyi b/stdlib/dataclasses.pyi index cf674911b03b..649084452eac 100644 --- a/stdlib/dataclasses.pyi +++ b/stdlib/dataclasses.pyi @@ -90,15 +90,15 @@ elif sys.version_info >= (3, 10): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... else: @@ -157,32 +157,32 @@ if sys.version_info >= (3, 10): def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, kw_only: bool = ..., ) -> Any: ... @@ -268,16 +268,16 @@ elif sys.version_info >= (3, 10): fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, ) -> type: ... else: diff --git a/stdlib/difflib.pyi b/stdlib/difflib.pyi index 9e7aeb40021f..b91cac81ff7c 100644 --- a/stdlib/difflib.pyi +++ b/stdlib/difflib.pyi @@ -29,16 +29,16 @@ class Match(NamedTuple): class SequenceMatcher(Generic[_T]): @overload - def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload - def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = ...) -> None: ... + def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... @overload def __init__( self: SequenceMatcher[str], - isjunk: Callable[[str], bool] | None = ..., - a: Sequence[str] = ..., - b: Sequence[str] = ..., - autojunk: bool = ..., + isjunk: Callable[[str], bool] | None = None, + a: Sequence[str] = '', + b: Sequence[str] = '', + autojunk: bool = True, ) -> None: ... def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... def set_seq1(self, a: Sequence[_T]) -> None: ... @@ -59,10 +59,10 @@ class SequenceMatcher(Generic[_T]): # mypy thinks the signatures of the overloads overlap, but the types still work fine @overload -def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...) -> list[AnyStr]: ... # type: ignore[misc] +def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ... # type: ignore[misc] @overload def get_close_matches( - word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ... + word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = 3, cutoff: float = 0.6 ) -> list[Sequence[_T]]: ... class Differ: diff --git a/stdlib/dis.pyi b/stdlib/dis.pyi index 4d39a54d41dd..cd3553bca69a 100644 --- a/stdlib/dis.pyi +++ b/stdlib/dis.pyi @@ -86,7 +86,7 @@ class Bytecode: cls: type[Self], tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False ) -> Self: ... else: - def __init__(self, x: _HaveCodeType | str, *, first_line: int | None = ..., current_offset: int | None = ...) -> None: ... + def __init__(self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None) -> None: ... @classmethod def from_traceback(cls: type[Self], tb: types.TracebackType) -> Self: ... @@ -113,7 +113,7 @@ if sys.version_info >= (3, 11): else: def dis( - x: _HaveCodeType | str | bytes | bytearray | None = ..., *, file: IO[str] | None = ..., depth: int | None = ... + x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None ) -> None: ... if sys.version_info >= (3, 11): @@ -131,9 +131,9 @@ if sys.version_info >= (3, 11): ) -> Iterator[Instruction]: ... else: - def disassemble(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def disco(co: _HaveCodeType, lasti: int = ..., *, file: IO[str] | None = ...) -> None: ... - def distb(tb: types.TracebackType | None = ..., *, file: IO[str] | None = ...) -> None: ... - def get_instructions(x: _HaveCodeType, *, first_line: int | None = ...) -> Iterator[Instruction]: ... + def disassemble(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def disco(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... + def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ... + def get_instructions(x: _HaveCodeType, *, first_line: int | None = None) -> Iterator[Instruction]: ... def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ... diff --git a/stdlib/distutils/fancy_getopt.pyi b/stdlib/distutils/fancy_getopt.pyi index e72e7996aaa0..153583be6b5d 100644 --- a/stdlib/distutils/fancy_getopt.pyi +++ b/stdlib/distutils/fancy_getopt.pyi @@ -14,7 +14,7 @@ class FancyGetopt: def __init__(self, option_table: list[_Option] | None = None) -> None: ... # TODO kinda wrong, `getopt(object=object())` is invalid @overload - def getopt(self, args: list[str] | None = ...) -> _GR: ... + def getopt(self, args: list[str] | None = None) -> _GR: ... @overload def getopt(self, args: list[str] | None, object: Any) -> list[str]: ... def get_option_order(self) -> list[tuple[str, str]]: ... diff --git a/stdlib/distutils/filelist.pyi b/stdlib/distutils/filelist.pyi index 4bd9d3a331eb..de1e4f4fb395 100644 --- a/stdlib/distutils/filelist.pyi +++ b/stdlib/distutils/filelist.pyi @@ -18,34 +18,34 @@ class FileList: def process_template_line(self, line: str) -> None: ... @overload def include_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... + def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> bool: ... @overload def include_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... @overload def exclude_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[0, False] = ... + self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... + def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> bool: ... @overload def exclude_pattern( - self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> bool: ... def findall(dir: str = ".") -> list[str]: ... def glob_to_re(pattern: str) -> str: ... @overload def translate_pattern( - pattern: str, anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: Literal[False, 0] = ... + pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[False, 0] = 0 ) -> Pattern[str]: ... @overload -def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... +def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> Pattern[str]: ... @overload def translate_pattern( - pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = ..., prefix: str | None = ..., is_regex: int = ... + pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 ) -> Pattern[str]: ... diff --git a/stdlib/email/feedparser.pyi b/stdlib/email/feedparser.pyi index 809f0b0e112b..4b7f73b9c015 100644 --- a/stdlib/email/feedparser.pyi +++ b/stdlib/email/feedparser.pyi @@ -9,7 +9,7 @@ _MessageT = TypeVar("_MessageT", bound=Message) class FeedParser(Generic[_MessageT]): @overload - def __init__(self: FeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: FeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... def feed(self, data: str) -> None: ... @@ -17,7 +17,7 @@ class FeedParser(Generic[_MessageT]): class BytesFeedParser(Generic[_MessageT]): @overload - def __init__(self: BytesFeedParser[Message], _factory: None = ..., *, policy: Policy = ...) -> None: ... + def __init__(self: BytesFeedParser[Message], _factory: None = None, *, policy: Policy = ...) -> None: ... @overload def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ... def feed(self, data: bytes | bytearray) -> None: ... diff --git a/stdlib/email/message.pyi b/stdlib/email/message.pyi index 8ea834c4cf93..d79f5b6a70d9 100644 --- a/stdlib/email/message.pyi +++ b/stdlib/email/message.pyi @@ -38,8 +38,8 @@ class Message: def keys(self) -> list[str]: ... def values(self) -> list[_HeaderType]: ... def items(self) -> list[tuple[str, _HeaderType]]: ... - def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ... - def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ... + def get(self, name: str, failobj: _T = None) -> _HeaderType | _T: ... + def get_all(self, name: str, failobj: _T = None) -> list[_HeaderType] | _T: ... def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... def replace_header(self, _name: str, _value: _HeaderType) -> None: ... def get_content_type(self) -> str: ... @@ -47,18 +47,18 @@ class Message: def get_content_subtype(self) -> str: ... def get_default_type(self) -> str: ... def set_default_type(self, ctype: str) -> None: ... - def get_params(self, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... - def get_param(self, param: str, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ... + def get_params(self, failobj: _T = None, header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... + def get_param(self, param: str, failobj: _T = None, header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ... def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ... def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ... - def get_filename(self, failobj: _T = ...) -> _T | str: ... - def get_boundary(self, failobj: _T = ...) -> _T | str: ... + def get_filename(self, failobj: _T = None) -> _T | str: ... + def get_boundary(self, failobj: _T = None) -> _T | str: ... def set_boundary(self, boundary: str) -> None: ... @overload def get_content_charset(self) -> str | None: ... @overload def get_content_charset(self, failobj: _T) -> str | _T: ... - def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ... + def get_charsets(self, failobj: _T = None) -> _T | list[str]: ... def walk(self: Self) -> Generator[Self, None, None]: ... def get_content_disposition(self) -> str | None: ... def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ... diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index b51b51c0e672..6fe26bf3cf1c 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -112,7 +112,7 @@ class EnumMeta(ABCMeta): def __dir__(self) -> list[str]: ... # Simple value lookup @overload # type: ignore[override] - def __call__(cls: type[_EnumMemberT], value: Any, names: None = ...) -> _EnumMemberT: ... + def __call__(cls: type[_EnumMemberT], value: Any, names: None = None) -> _EnumMemberT: ... # Functional Enum API if sys.version_info >= (3, 11): @overload @@ -134,10 +134,10 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, ) -> type[Enum]: ... _member_names_: list[str] # undocumented _member_map_: dict[str, Enum] # undocumented diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index dc51b0a2a238..ad491df27a8b 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -36,36 +36,36 @@ if sys.version_info >= (3, 10): # encoding and errors are added @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> FileInput[Any]: ... elif sys.version_info >= (3, 8): @@ -164,38 +164,38 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., - encoding: None = ..., - errors: None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... elif sys.version_info >= (3, 8): diff --git a/stdlib/fractions.pyi b/stdlib/fractions.pyi index 1cad2353ed8d..95e4aad0f9ca 100644 --- a/stdlib/fractions.pyi +++ b/stdlib/fractions.pyi @@ -24,10 +24,10 @@ else: class Fraction(Rational): @overload def __new__( - cls: type[Self], numerator: int | Rational = ..., denominator: int | Rational | None = ..., *, _normalize: bool = ... + cls: type[Self], numerator: int | Rational = 0, denominator: int | Rational | None = None, *, _normalize: bool = True ) -> Self: ... @overload - def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = ...) -> Self: ... + def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = True) -> Self: ... @classmethod def from_float(cls: type[Self], f: float) -> Self: ... @classmethod @@ -129,7 +129,7 @@ class Fraction(Rational): def __floor__(a) -> int: ... def __ceil__(a) -> int: ... @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @overload def __round__(self, ndigits: int) -> Fraction: ... def __hash__(self) -> int: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 2174e8c573bc..976cb082e4f9 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -55,9 +55,9 @@ class _lru_cache_wrapper(Generic[_T]): if sys.version_info >= (3, 8): @overload - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @overload - def lru_cache(maxsize: Callable[..., _T], typed: bool = ...) -> _lru_cache_wrapper[_T]: ... + def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ... else: def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... @@ -132,9 +132,9 @@ if sys.version_info >= (3, 8): @property def __isabstractmethod__(self) -> bool: ... @overload - def register(self, cls: type[Any], method: None = ...) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... + def register(self, cls: type[Any], method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... @overload - def register(self, cls: Callable[..., _T], method: None = ...) -> Callable[..., _T]: ... + def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ... @overload def register(self, cls: type[Any], method: Callable[..., _T]) -> Callable[..., _T]: ... def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ... @@ -144,9 +144,9 @@ if sys.version_info >= (3, 8): attrname: str | None def __init__(self, func: Callable[[Any], _T]) -> None: ... @overload - def __get__(self, instance: None, owner: type[Any] | None = ...) -> cached_property[_T]: ... + def __get__(self, instance: None, owner: type[Any] | None = None) -> cached_property[_T]: ... @overload - def __get__(self, instance: object, owner: type[Any] | None = ...) -> _T: ... + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ... def __set_name__(self, owner: type[Any], name: str) -> None: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 83cf65dcb61c..5506fbad4a72 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -59,14 +59,14 @@ class GNUTranslations(NullTranslations): @overload # ignores incompatible overloads def find( # type: ignore[misc] - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[False] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[False] = False ) -> str | None: ... @overload def find( - domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[True] = ... + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[True] = False ) -> list[str]: ... @overload -def find(domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: bool = ...) -> Any: ... +def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... _NullTranslationsT = TypeVar("_NullTranslationsT", bound=NullTranslations) @@ -110,20 +110,20 @@ else: @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, codeset: str | None = ..., ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, codeset: str | None = ..., ) -> _NullTranslationsT: ... @overload @@ -132,20 +132,20 @@ else: localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, codeset: str | None = ..., ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, codeset: str | None = ..., ) -> NullTranslations: ... def install( - domain: str, localedir: StrPath | None = ..., codeset: str | None = ..., names: Container[str] | None = ... + domain: str, localedir: StrPath | None = None, codeset: str | None = ..., names: Container[str] | None = None ) -> None: ... def textdomain(domain: str | None = None) -> str: ... @@ -166,6 +166,6 @@ if sys.version_info < (3, 11): def ldgettext(domain: str, message: str) -> str: ... def lngettext(msgid1: str, msgid2: str, n: int) -> str: ... def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... - def bind_textdomain_codeset(domain: str, codeset: str | None = ...) -> str: ... + def bind_textdomain_codeset(domain: str, codeset: str | None = None) -> str: ... Catalog = translation diff --git a/stdlib/glob.pyi b/stdlib/glob.pyi index d6c885d70792..3f37a99e8505 100644 --- a/stdlib/glob.pyi +++ b/stdlib/glob.pyi @@ -28,10 +28,10 @@ if sys.version_info >= (3, 11): elif sys.version_info >= (3, 10): def glob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> list[AnyStr]: ... def iglob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = ..., dir_fd: int | None = ..., recursive: bool = ... + pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False ) -> Iterator[AnyStr]: ... else: diff --git a/stdlib/graphlib.pyi b/stdlib/graphlib.pyi index 4c6959decc4b..c02d447ad501 100644 --- a/stdlib/graphlib.pyi +++ b/stdlib/graphlib.pyi @@ -12,7 +12,7 @@ if sys.version_info >= (3, 11): class TopologicalSorter(Generic[_T]): @overload - def __init__(self, graph: None = ...) -> None: ... + def __init__(self, graph: None = None) -> None: ... @overload def __init__(self, graph: SupportsItems[_T, Iterable[_T]]) -> None: ... def add(self, node: _T, *predecessors: _T) -> None: ... diff --git a/stdlib/gzip.pyi b/stdlib/gzip.pyi index 01c285d94d9e..f61d36f05d10 100644 --- a/stdlib/gzip.pyi +++ b/stdlib/gzip.pyi @@ -43,38 +43,38 @@ class _WritableFileobj(Protocol): @overload def open( filename: StrOrBytesPath | _ReadableFileobj, - mode: _ReadBinaryMode = ..., - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + mode: _ReadBinaryMode = 'rb', + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath | _WritableFileobj, mode: _WriteBinaryMode, - compresslevel: int = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + compresslevel: int = 9, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> GzipFile: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextMode, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, mode: str, - compresslevel: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + compresslevel: int = 9, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> GzipFile | TextIO: ... class _PaddedFile: @@ -99,45 +99,45 @@ class GzipFile(_compression.BaseStream): self, filename: StrOrBytesPath | None, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _ReadBinaryMode, - compresslevel: int = ..., - fileobj: _ReadableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _ReadableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath | None, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, *, mode: _WriteBinaryMode, - compresslevel: int = ..., - fileobj: _WritableFileobj | None = ..., - mtime: float | None = ..., + compresslevel: int = 9, + fileobj: _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @overload def __init__( self, - filename: StrOrBytesPath | None = ..., - mode: str | None = ..., - compresslevel: int = ..., - fileobj: _ReadableFileobj | _WritableFileobj | None = ..., - mtime: float | None = ..., + filename: StrOrBytesPath | None = None, + mode: str | None = None, + compresslevel: int = 9, + fileobj: _ReadableFileobj | _WritableFileobj | None = None, + mtime: float | None = None, ) -> None: ... @property def filename(self) -> str: ... diff --git a/stdlib/imghdr.pyi b/stdlib/imghdr.pyi index 5f439779a69c..ed3647f20fc5 100644 --- a/stdlib/imghdr.pyi +++ b/stdlib/imghdr.pyi @@ -10,7 +10,7 @@ class _ReadableBinary(Protocol): def seek(self, offset: int) -> Any: ... @overload -def what(file: StrPath | _ReadableBinary, h: None = ...) -> str | None: ... +def what(file: StrPath | _ReadableBinary, h: None = None) -> str | None: ... @overload def what(file: Any, h: bytes) -> str | None: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index bac7b50c6737..0cd360d9cc54 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -123,7 +123,7 @@ if sys.version_info >= (3, 9): @abstractmethod def open( self, - mode: OpenTextMode = ..., + mode: OpenTextMode = 'r', buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index 0e9c3bce9993..a3d3e96c2217 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -442,9 +442,9 @@ def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... if sys.version_info < (3, 11): def formatargspec( args: list[str], - varargs: str | None = ..., - varkw: str | None = ..., - defaults: tuple[Any, ...] | None = ..., + varargs: str | None = None, + varkw: str | None = None, + defaults: tuple[Any, ...] | None = None, kwonlyargs: Sequence[str] | None = ..., kwonlydefaults: Mapping[str, Any] | None = ..., annotations: Mapping[str, Any] = ..., diff --git a/stdlib/lib2to3/pytree.pyi b/stdlib/lib2to3/pytree.pyi index ff3ac1a4dc25..cb56d20f6c36 100644 --- a/stdlib/lib2to3/pytree.pyi +++ b/stdlib/lib2to3/pytree.pyi @@ -83,7 +83,7 @@ class NodePattern(BasePattern): class WildcardPattern(BasePattern): min: int max: int - def __init__(self, content: str | None = None, min: int = 0, max: int = ..., name: str | None = None) -> None: ... + def __init__(self, content: str | None = None, min: int = 0, max: int = 2147483647, name: str | None = None) -> None: ... class NegatedPattern(BasePattern): def __init__(self, content: str | None = None) -> None: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index a103aacd3e0e..6bfd92f1d3b2 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -771,7 +771,7 @@ class StreamHandler(Handler, Generic[_StreamT]): stream: _StreamT # undocumented terminator: str @overload - def __init__(self: StreamHandler[TextIO], stream: None = ...) -> None: ... + def __init__(self: StreamHandler[TextIO], stream: None = None) -> None: ... @overload def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... def setStream(self, stream: _StreamT) -> _StreamT | None: ... diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index ff9aaf8283e1..f8f93b5a91f0 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -210,7 +210,7 @@ class SMTPHandler(Handler): subject: str, credentials: tuple[str, str] | None = None, secure: tuple[()] | tuple[str] | tuple[str, str] | None = None, - timeout: float = ..., + timeout: float = 5.0, ) -> None: ... def getSubject(self, record: LogRecord) -> str: ... diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index 0f1fa8de4193..d32b5425898a 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -126,67 +126,67 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): @overload def open( filename: _PathOrFile, - mode: Literal["r", "rb"] = ..., + mode: Literal["r", "rb"] = 'rb', *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: _PathOrFile, mode: _OpenBinaryWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> LZMAFile: ... @overload def open( filename: StrOrBytesPath, mode: Literal["rt"], *, - format: int | None = ..., - check: Literal[-1] = ..., - preset: None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: Literal[-1] = -1, + preset: None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: StrOrBytesPath, mode: _OpenTextWritingMode, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIO: ... @overload def open( filename: _PathOrFile, mode: str, *, - format: int | None = ..., - check: int = ..., - preset: int | None = ..., - filters: _FilterChain | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + format: int | None = None, + check: int = -1, + preset: int | None = None, + filters: _FilterChain | None = None, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> LZMAFile | TextIO: ... def compress( data: ReadableBuffer, format: int = 1, check: int = -1, preset: int | None = None, filters: _FilterChain | None = None diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 229052f91ecc..7af718d4191d 100644 --- a/stdlib/mailbox.pyi +++ b/stdlib/mailbox.pyi @@ -50,9 +50,9 @@ class Mailbox(Generic[_MessageT]): _path: str # undocumented _factory: Callable[[IO[Any]], _MessageT] | None # undocumented @overload - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = True) -> None: ... @overload - def __init__(self, path: StrPath, factory: None = ..., create: bool = ...) -> None: ... + def __init__(self, path: StrPath, factory: None = None, create: bool = True) -> None: ... @abstractmethod def add(self, message: _MessageData) -> str: ... @abstractmethod @@ -62,7 +62,7 @@ class Mailbox(Generic[_MessageT]): @abstractmethod def __setitem__(self, key: str, message: _MessageData) -> None: ... @overload - def get(self, key: str, default: None = ...) -> _MessageT | None: ... + def get(self, key: str, default: None = None) -> _MessageT | None: ... @overload def get(self, key: str, default: _T) -> _MessageT | _T: ... def __getitem__(self, key: str) -> _MessageT: ... @@ -88,9 +88,9 @@ class Mailbox(Generic[_MessageT]): def __len__(self) -> int: ... def clear(self) -> None: ... @overload - def pop(self, key: str, default: None = ...) -> _MessageT | None: ... + 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 = None) -> _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/stdlib/math.pyi b/stdlib/math.pyi index ca30acd7e97d..23bacfefd1e3 100644 --- a/stdlib/math.pyi +++ b/stdlib/math.pyi @@ -91,8 +91,8 @@ def isclose( a: _SupportsFloatOrIndex, b: _SupportsFloatOrIndex, *, - rel_tol: _SupportsFloatOrIndex = ..., - abs_tol: _SupportsFloatOrIndex = ..., + rel_tol: _SupportsFloatOrIndex = 1e-09, + abs_tol: _SupportsFloatOrIndex = 0.0, ) -> bool: ... def isinf(__x: _SupportsFloatOrIndex) -> bool: ... def isfinite(__x: _SupportsFloatOrIndex) -> bool: ... @@ -122,9 +122,9 @@ def pow(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... if sys.version_info >= (3, 8): @overload - def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = ...) -> int: ... # type: ignore[misc] + def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = 1) -> int: ... # type: ignore[misc] @overload - def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = ...) -> float: ... + def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = 1) -> float: ... def radians(__x: _SupportsFloatOrIndex) -> float: ... def remainder(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ... diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index decbf2fee19d..e39737e05452 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -54,4 +54,4 @@ class MimeTypes: def read(self, filename: str, strict: bool = True) -> None: ... def readfp(self, fp: IO[str], strict: bool = True) -> None: ... if sys.platform == "win32": - def read_windows_registry(self, strict: bool = ...) -> None: ... + def read_windows_registry(self, strict: bool = True) -> None: ... diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index 0e18350b226e..8035bfefe4b3 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -82,19 +82,19 @@ if sys.platform == "win32": physical: str, _logical: str, default: str, - componentflags: int | None = ..., + componentflags: int | None = None, ) -> None: ... def start_component( self, - component: str | None = ..., - feature: Feature | None = ..., - flags: int | None = ..., - keyfile: str | None = ..., - uuid: str | None = ..., + component: str | None = None, + feature: Feature | None = None, + flags: int | None = None, + keyfile: str | None = None, + uuid: str | None = None, ) -> None: ... def make_short(self, file: str) -> str: ... - def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ... - def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ... + def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str: ... + def glob(self, pattern: str, exclude: Container[str] | None = None) -> list[str]: ... def remove_pyc(self) -> None: ... class Binary: @@ -112,10 +112,10 @@ if sys.platform == "win32": title: str, desc: str, display: int, - level: int = ..., - parent: Feature | None = ..., - directory: str | None = ..., - attributes: int = ..., + level: int = 1, + parent: Feature | None = None, + directory: str | None = None, + attributes: int = 0, ) -> None: ... def set_current(self) -> None: ... @@ -124,7 +124,7 @@ if sys.platform == "win32": dlg: Dialog name: str def __init__(self, dlg: Dialog, name: str) -> None: ... - def event(self, event: str, argument: str, condition: str = ..., ordering: int | None = ...) -> None: ... + def event(self, event: str, argument: str, condition: str = '1', ordering: int | None = None) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... @@ -133,7 +133,7 @@ if sys.platform == "win32": property: str index: int def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... - def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = ...) -> None: ... + def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = None) -> None: ... class Dialog: diff --git a/stdlib/multiprocessing/connection.pyi b/stdlib/multiprocessing/connection.pyi index ef1aad05e5a9..392e3168aaaa 100644 --- a/stdlib/multiprocessing/connection.pyi +++ b/stdlib/multiprocessing/connection.pyi @@ -26,7 +26,7 @@ class _ConnectionBase: def recv_bytes(self, maxlength: int | None = None) -> bytes: ... def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ... def recv(self) -> Any: ... - def poll(self, timeout: float | None = ...) -> bool: ... + def poll(self, timeout: float | None = 0.0) -> bool: ... def __enter__(self: Self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: types.TracebackType | None @@ -66,4 +66,4 @@ if sys.platform != "win32": def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ... else: - def Pipe(duplex: bool = ...) -> tuple[PipeConnection, PipeConnection]: ... + def Pipe(duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... diff --git a/stdlib/multiprocessing/context.pyi b/stdlib/multiprocessing/context.pyi index c462be5838f1..fa8caf6577f0 100644 --- a/stdlib/multiprocessing/context.pyi +++ b/stdlib/multiprocessing/context.pyi @@ -54,7 +54,7 @@ class BaseContext: if sys.platform != "win32": def Pipe(self, duplex: bool = True) -> tuple[Connection, Connection]: ... else: - def Pipe(self, duplex: bool = ...) -> tuple[PipeConnection, PipeConnection]: ... + def Pipe(self, duplex: bool = True) -> tuple[PipeConnection, PipeConnection]: ... def Barrier( self, parties: int, action: Callable[..., object] | None = None, timeout: float | None = None @@ -86,24 +86,24 @@ class BaseContext: @overload def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[False]) -> _CT: ... @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[_CT]: ... + def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[_CT]: ... @overload - def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ...) -> SynchronizedBase[Any]: ... + def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True) -> SynchronizedBase[Any]: ... @overload - def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ...) -> Any: ... + def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ... @overload def Array(self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False]) -> _CT: ... @overload def Array( - self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[_CT]: ... @overload def Array( - self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = ... + self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True ) -> SynchronizedArray[Any]: ... @overload def Array( - self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = ... + self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = True ) -> Any: ... def freeze_support(self) -> None: ... def get_logger(self) -> Logger: ... @@ -124,14 +124,14 @@ class BaseContext: def get_context(self, method: str) -> BaseContext: ... else: @overload - def get_context(self, method: None = ...) -> DefaultContext: ... + def get_context(self, method: None = None) -> DefaultContext: ... @overload def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... @overload def get_context(self, method: str) -> BaseContext: ... @overload - def get_start_method(self, allow_none: Literal[False] = ...) -> str: ... + def get_start_method(self, allow_none: Literal[False] = False) -> str: ... @overload def get_start_method(self, allow_none: bool) -> str | None: ... def set_start_method(self, method: str | None, force: bool = False) -> None: ... diff --git a/stdlib/multiprocessing/dummy/connection.pyi b/stdlib/multiprocessing/dummy/connection.pyi index 690b9d258f3c..1630472b3b06 100644 --- a/stdlib/multiprocessing/dummy/connection.pyi +++ b/stdlib/multiprocessing/dummy/connection.pyi @@ -23,7 +23,7 @@ class Connection: ) -> None: ... def __init__(self, _in: Any, _out: Any) -> None: ... def close(self) -> None: ... - def poll(self, timeout: float = ...) -> bool: ... + def poll(self, timeout: float = 0.0) -> bool: ... class Listener: _backlog_queue: Queue[Any] | None diff --git a/stdlib/multiprocessing/heap.pyi b/stdlib/multiprocessing/heap.pyi index b5e2ced5e8ee..114bdf0d4e57 100644 --- a/stdlib/multiprocessing/heap.pyi +++ b/stdlib/multiprocessing/heap.pyi @@ -27,7 +27,7 @@ if sys.platform != "win32": def rebuild_arena(size: int, dupfd: _SupportsDetach) -> Arena: ... class Heap: - def __init__(self, size: int = ...) -> None: ... + def __init__(self, size: int = 4096) -> None: ... def free(self, block: _Block) -> None: ... def malloc(self, size: int) -> _Block: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index efee27f91265..c29d49708b4c 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -141,7 +141,7 @@ class BaseManager: ) -> None: ... else: def __init__( - self, address: Any | None = ..., authkey: bytes | None = ..., serializer: str = ..., ctx: BaseContext | None = ... + self, address: Any | None = None, authkey: bytes | None = None, serializer: str = 'pickle', ctx: BaseContext | None = None ) -> None: ... def get_server(self) -> Server: ... diff --git a/stdlib/multiprocessing/popen_spawn_win32.pyi b/stdlib/multiprocessing/popen_spawn_win32.pyi index f5cb0a6c4844..3dc9d5bd7332 100644 --- a/stdlib/multiprocessing/popen_spawn_win32.pyi +++ b/stdlib/multiprocessing/popen_spawn_win32.pyi @@ -21,7 +21,7 @@ if sys.platform == "win32": def __init__(self, process_obj: BaseProcess) -> None: ... def duplicate_for_child(self, handle: int) -> int: ... - def wait(self, timeout: float | None = ...) -> int | None: ... + def wait(self, timeout: float | None = None) -> int | None: ... def poll(self) -> int | None: ... def terminate(self) -> None: ... diff --git a/stdlib/multiprocessing/reduction.pyi b/stdlib/multiprocessing/reduction.pyi index 578b68d81b45..49648e4490ee 100644 --- a/stdlib/multiprocessing/reduction.pyi +++ b/stdlib/multiprocessing/reduction.pyi @@ -34,7 +34,7 @@ def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None) -> N if sys.platform == "win32": if sys.version_info >= (3, 8): def duplicate( - handle: int, target_process: int | None = ..., inheritable: bool = ..., *, source_process: int | None = ... + handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None ) -> int: ... else: def duplicate(handle: int, target_process: int | None = ..., inheritable: bool = ...) -> int: ... @@ -44,7 +44,7 @@ if sys.platform == "win32": def recv_handle(conn: connection.PipeConnection) -> int: ... class DupHandle: - def __init__(self, handle: int, access: int, pid: int | None = ...) -> None: ... + def __init__(self, handle: int, access: int, pid: int | None = None) -> None: ... def detach(self) -> int: ... else: diff --git a/stdlib/multiprocessing/shared_memory.pyi b/stdlib/multiprocessing/shared_memory.pyi index 84fb89d8d53f..841c947360e8 100644 --- a/stdlib/multiprocessing/shared_memory.pyi +++ b/stdlib/multiprocessing/shared_memory.pyi @@ -24,9 +24,9 @@ class SharedMemory: class ShareableList(Generic[_SLT]): shm: SharedMemory @overload - def __init__(self, sequence: None = ..., *, name: str | None = ...) -> None: ... + def __init__(self, sequence: None = None, *, name: str | None = None) -> None: ... @overload - def __init__(self, sequence: Iterable[_SLT], *, name: str | None = ...) -> None: ... + def __init__(self, sequence: Iterable[_SLT], *, name: str | None = None) -> None: ... def __getitem__(self, position: int) -> _SLT: ... def __setitem__(self, position: int, value: _SLT) -> None: ... def __reduce__(self: Self) -> tuple[Self, tuple[_SLT, ...]]: ... diff --git a/stdlib/multiprocessing/sharedctypes.pyi b/stdlib/multiprocessing/sharedctypes.pyi index f0a1f500c71f..686a45d9ae41 100644 --- a/stdlib/multiprocessing/sharedctypes.pyi +++ b/stdlib/multiprocessing/sharedctypes.pyi @@ -21,56 +21,56 @@ def RawArray(typecode_or_type: type[_CT], size_or_initializer: int | Sequence[An @overload def RawArray(typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> Any: ... @overload -def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = ...) -> _CT: ... +def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = None) -> _CT: ... @overload def Value( - typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[_CT]: ... @overload def Value( - typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None ) -> SynchronizedBase[Any]: ... @overload def Value( - typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = ..., ctx: BaseContext | None = ... + typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True, ctx: BaseContext | None = None ) -> Any: ... @overload def Array( - typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = ... + typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = None ) -> _CT: ... @overload def Array( typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[_CT]: ... @overload def Array( typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, - lock: Literal[True] | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: Literal[True] | _LockLike = True, + ctx: BaseContext | None = None, ) -> SynchronizedArray[Any]: ... @overload def Array( typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, - lock: bool | _LockLike = ..., - ctx: BaseContext | None = ..., + lock: bool | _LockLike = True, + ctx: BaseContext | None = None, ) -> Any: ... def copy(obj: _CT) -> _CT: ... @overload -def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = ..., ctx: Any | None = ...) -> Synchronized[_T]: ... +def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ... @overload -def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedString: ... +def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... @overload -def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedArray[_CT]: ... +def synchronized(obj: ctypes.Array[_CT], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedArray[_CT]: ... @overload -def synchronized(obj: _CT, lock: _LockLike | None = ..., ctx: Any | None = ...) -> SynchronizedBase[_CT]: ... +def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ... class _AcquireFunc(Protocol): def __call__(self, block: bool = ..., timeout: float | None = ...) -> bool: ... diff --git a/stdlib/ntpath.pyi b/stdlib/ntpath.pyi index 0cd3e446475b..f1fa137c6d88 100644 --- a/stdlib/ntpath.pyi +++ b/stdlib/ntpath.pyi @@ -101,9 +101,9 @@ def join(__path: BytesPath, *paths: BytesPath) -> bytes: ... if sys.platform == "win32": if sys.version_info >= (3, 10): @overload - def realpath(path: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(path: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload def realpath(path: PathLike[AnyStr]) -> AnyStr: ... diff --git a/stdlib/numbers.pyi b/stdlib/numbers.pyi index eacd87c00bad..55f21041ae44 100644 --- a/stdlib/numbers.pyi +++ b/stdlib/numbers.pyi @@ -60,7 +60,7 @@ class Real(Complex, SupportsFloat): def __ceil__(self) -> int: ... @abstractmethod @overload - def __round__(self, ndigits: None = ...) -> int: ... + def __round__(self, ndigits: None = None) -> int: ... @abstractmethod @overload def __round__(self, ndigits: int) -> Any: ... diff --git a/stdlib/optparse.pyi b/stdlib/optparse.pyi index a049fdad71c7..a8c1c4cfb93e 100644 --- a/stdlib/optparse.pyi +++ b/stdlib/optparse.pyi @@ -240,9 +240,9 @@ class OptionParser(OptionContainer): def get_usage(self) -> str: ... def get_version(self) -> str: ... @overload - def parse_args(self, args: None = ..., values: Values | None = ...) -> tuple[Values, list[str]]: ... + def parse_args(self, args: None = None, values: Values | None = None) -> tuple[Values, list[str]]: ... @overload - def parse_args(self, args: Sequence[AnyStr], values: Values | None = ...) -> tuple[Values, list[AnyStr]]: ... + def parse_args(self, args: Sequence[AnyStr], values: Values | None = None) -> tuple[Values, list[AnyStr]]: ... def print_usage(self, file: IO[str] | None = None) -> None: ... def print_help(self, file: IO[str] | None = None) -> None: ... def print_version(self, file: IO[str] | None = None) -> None: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index eea6d88b5467..672c7794730e 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -367,7 +367,7 @@ class PathLike(Protocol[AnyStr_co]): def __fspath__(self) -> AnyStr_co: ... @overload -def listdir(path: StrPath | None = ...) -> list[str]: ... +def listdir(path: StrPath | None = None) -> list[str]: ... @overload def listdir(path: BytesPath) -> list[bytes]: ... @overload @@ -516,9 +516,9 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def fdopen( fd: int, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., + mode: OpenTextMode = 'r', + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -529,7 +529,7 @@ def fdopen( fd: int, mode: OpenBinaryMode, buffering: Literal[0], - encoding: None = ..., + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -539,8 +539,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -550,8 +550,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -561,8 +561,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -572,8 +572,8 @@ def fdopen( def fdopen( fd: int, mode: OpenBinaryMode, - buffering: int = ..., - encoding: None = ..., + buffering: int = -1, + encoding: None = None, errors: None = ..., newline: None = ..., closefd: bool = ..., @@ -583,8 +583,8 @@ def fdopen( def fdopen( fd: int, mode: str, - buffering: int = ..., - encoding: str | None = ..., + buffering: int = -1, + encoding: str | None = None, errors: str | None = ..., newline: str | None = ..., closefd: bool = ..., @@ -737,7 +737,7 @@ class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_Scand def close(self) -> None: ... @overload -def scandir(path: None = ...) -> _ScandirIterator[str]: ... +def scandir(path: None = None) -> _ScandirIterator[str]: ... @overload def scandir(path: int) -> _ScandirIterator[str]: ... @overload diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index fd23484009ff..9e56d9a8f25f 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -106,54 +106,54 @@ class Path(PurePath): @overload def open( self, - mode: OpenTextMode = ..., - buffering: int = ..., - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + mode: OpenTextMode = 'r', + buffering: int = -1, + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... # Unbuffered binary mode: returns a FileIO @overload 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 def open( self, mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedRandom: ... @overload def open( self, mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedWriter: ... @overload def open( self, mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = ..., - encoding: None = ..., - errors: None = ..., - newline: None = ..., + buffering: Literal[-1, 1] = -1, + encoding: None = None, + errors: None = None, + newline: None = None, ) -> BufferedReader: ... # Buffering cannot be determined: fall back to BinaryIO @overload def open( - self, mode: OpenBinaryMode, buffering: int = ..., encoding: None = ..., errors: None = ..., newline: None = ... + self, mode: OpenBinaryMode, buffering: int = -1, encoding: None = None, errors: None = None, newline: None = None ) -> BinaryIO: ... # Fallback if mode is not specified @overload def open( - self, mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... + self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> IO[Any]: ... if sys.platform != "win32": # These methods do "exist" on Windows, but they always raise NotImplementedError, diff --git a/stdlib/posixpath.pyi b/stdlib/posixpath.pyi index ff9c2482ace5..1945190be5f8 100644 --- a/stdlib/posixpath.pyi +++ b/stdlib/posixpath.pyi @@ -118,9 +118,9 @@ def join(__a: BytesPath, *paths: BytesPath) -> bytes: ... if sys.version_info >= (3, 10): @overload - def realpath(filename: PathLike[AnyStr], *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... @overload - def realpath(filename: AnyStr, *, strict: bool = ...) -> AnyStr: ... + def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ... else: @overload @@ -129,11 +129,11 @@ else: def realpath(filename: AnyStr) -> AnyStr: ... @overload -def relpath(path: LiteralString, start: LiteralString | None = ...) -> LiteralString: ... +def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ... @overload -def relpath(path: BytesPath, start: BytesPath | None = ...) -> bytes: ... +def relpath(path: BytesPath, start: BytesPath | None = None) -> bytes: ... @overload -def relpath(path: StrPath, start: StrPath | None = ...) -> str: ... +def relpath(path: StrPath, start: StrPath | None = None) -> str: ... @overload def split(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... @overload diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index 904550a66223..2634a267ccb4 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -58,7 +58,7 @@ class Doc: def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ... - def getdocloc(self, object: object, basedir: str = ...) -> str | None: ... + def getdocloc(self, object: object, basedir: str = 'C:\\Users\\alexw\\AppData\\Local\\Programs\\Python\\Python310\\Lib') -> str | None: ... class HTMLRepr(Repr): def escape(self, text: str) -> str: ... @@ -88,19 +88,19 @@ class HTMLDoc(Doc): ) -> str: ... def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ... else: - def heading(self, title: str, fgcol: str, bgcol: str, extras: str = ...) -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = '') -> str: ... def section( self, title: str, fgcol: str, bgcol: str, contents: str, - width: int = ..., - prelude: str = ..., - marginalia: str | None = ..., - gap: str = ..., + width: int = 6, + prelude: str = '', + marginalia: str | None = None, + gap: str = ' ', ) -> str: ... - def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = ...) -> str: ... + def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = 4) -> str: ... def bigsection(self, title: str, *args: Any) -> str: ... def preformat(self, text: str) -> str: ... diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 18a9e1813dae..ae67e988d7bb 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -67,18 +67,18 @@ class Random(_random.Random): if sys.version_info >= (3, 11): def shuffle(self, x: MutableSequence[Any]) -> None: ... else: - def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = ...) -> None: ... + def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = None) -> None: ... if sys.version_info >= (3, 11): def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = None) -> list[_T]: ... elif sys.version_info >= (3, 9): def sample( - self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = ... + self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = None ) -> list[_T]: ... else: def sample(self, population: Sequence[_T] | AbstractSet[_T], k: int) -> list[_T]: ... def uniform(self, a: float, b: float) -> float: ... - def triangular(self, low: float = ..., high: float = ..., mode: float | None = None) -> float: ... + def triangular(self, low: float = 0.0, high: float = 1.0, mode: float | None = None) -> float: ... def betavariate(self, alpha: float, beta: float) -> float: ... def expovariate(self, lambd: float) -> float: ... def gammavariate(self, alpha: float, beta: float) -> float: ... diff --git a/stdlib/re.pyi b/stdlib/re.pyi index 12771441b779..636b94bcaa57 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -115,64 +115,64 @@ class Pattern(Generic[AnyStr]): @property def pattern(self) -> AnyStr: ... @overload - def search(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... # type: ignore[misc] + def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def search(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ... + def search(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... @overload - def match(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... # type: ignore[misc] + def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def match(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ... + def match(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... @overload - def fullmatch(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Match[str] | None: ... + def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... @overload - def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Match[bytes] | None: ... # type: ignore[misc] + def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def fullmatch(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr] | None: ... + def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... @overload - def split(self: Pattern[str], string: str, maxsplit: int = ...) -> list[str | Any]: ... + def split(self: Pattern[str], string: str, maxsplit: int = 0) -> list[str | Any]: ... @overload - def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = ...) -> list[bytes | Any]: ... + def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0) -> list[bytes | Any]: ... @overload - def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr | Any]: ... + def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | Any]: ... # return type depends on the number of groups in the pattern @overload - def findall(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> list[Any]: ... @overload - def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> list[Any]: ... + def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> list[Any]: ... @overload - def findall(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> list[AnyStr]: ... + def findall(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> list[AnyStr]: ... @overload - def finditer(self: Pattern[str], string: str, pos: int = ..., endpos: int = ...) -> Iterator[Match[str]]: ... + def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[str]]: ... @overload - def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = ..., endpos: int = ...) -> Iterator[Match[bytes]]: ... # type: ignore[misc] + def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[bytes]]: ... # type: ignore[misc] @overload - def finditer(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Iterator[Match[AnyStr]]: ... + def finditer(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[AnyStr]]: ... @overload - def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> str: ... + def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... @overload def sub( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> bytes: ... @overload - def sub(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ...) -> AnyStr: ... + def sub(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> AnyStr: ... @overload - def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ...) -> tuple[str, int]: ... + def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ... @overload def subn( # type: ignore[misc] self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., + count: int = 0, ) -> tuple[bytes, int]: ... @overload - def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ...) -> tuple[AnyStr, int]: ... + def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> tuple[AnyStr, int]: ... def __copy__(self) -> Pattern[AnyStr]: ... def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ... if sys.version_info >= (3, 9): @@ -230,58 +230,58 @@ _FlagsType: TypeAlias = int | RegexFlag # pattern arguments do *not* accept arbitrary buffers such as bytearray, # because the pattern must be hashable. @overload -def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: AnyStr, flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ... +def compile(pattern: Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... @overload -def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Match[str] | None: ... +def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... @overload -def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Match[bytes] | None: ... +def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... @overload -def split(pattern: str | Pattern[str], string: str, maxsplit: int = ..., flags: _FlagsType = ...) -> list[str | Any]: ... +def split(pattern: str | Pattern[str], string: str, maxsplit: int = 0, flags: _FlagsType = 0) -> list[str | Any]: ... @overload def split( - pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = ..., flags: _FlagsType = ... + pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0, flags: _FlagsType = 0 ) -> list[bytes | Any]: ... @overload -def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ... @overload -def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> list[Any]: ... +def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ... @overload -def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = ...) -> Iterator[Match[str]]: ... +def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Iterator[Match[str]]: ... @overload -def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = ...) -> Iterator[Match[bytes]]: ... +def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Iterator[Match[bytes]]: ... @overload def sub( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> str: ... @overload def sub( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> bytes: ... @overload def subn( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = ..., flags: _FlagsType = ... + pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 ) -> tuple[str, int]: ... @overload def subn( pattern: bytes | Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, - count: int = ..., - flags: _FlagsType = ..., + count: int = 0, + flags: _FlagsType = 0, ) -> tuple[bytes, int]: ... def escape(pattern: AnyStr) -> AnyStr: ... def purge() -> None: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 0f088268e95f..1b4c092aa609 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -52,13 +52,13 @@ def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: boo def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... @overload -def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: StrPath, dst: StrPath, *, follow_symlinks: bool = True) -> _PathReturn: ... @overload -def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = ...) -> _PathReturn: ... +def copy2(src: BytesPath, dst: BytesPath, *, follow_symlinks: bool = True) -> _PathReturn: ... def ignore_patterns(*patterns: StrPath) -> Callable[[Any, list[str]], set[str]]: ... if sys.version_info >= (3, 8): @@ -124,9 +124,9 @@ def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ... # see https://bugs.python.org/issue33140. We keep it here because it's # in __all__. @overload -def chown(path: StrOrBytesPath, user: str | int, group: None = ...) -> None: ... +def chown(path: StrOrBytesPath, user: str | int, group: None = None) -> None: ... @overload -def chown(path: StrOrBytesPath, user: None = ..., *, group: str | int) -> None: ... +def chown(path: StrOrBytesPath, user: None = None, *, group: str | int) -> None: ... @overload def chown(path: StrOrBytesPath, user: None, group: str | int) -> None: ... @overload @@ -134,9 +134,9 @@ def chown(path: StrOrBytesPath, user: str | int, group: str | int) -> None: ... if sys.version_info >= (3, 8): @overload - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... @overload - def which(cmd: bytes, mode: int = ..., path: StrPath | None = ...) -> bytes | None: ... + def which(cmd: bytes, mode: int = 1, path: StrPath | None = None) -> bytes | None: ... else: def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... @@ -155,11 +155,11 @@ def make_archive( def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = ... + name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = '' ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = '' ) -> None: ... def unregister_archive_format(name: str) -> None: ... def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... @@ -169,11 +169,11 @@ def register_unpack_format( extensions: list[str], function: Callable[..., object], extra_args: Sequence[tuple[str, Any]], - description: str = ..., + description: str = '', ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = ..., description: str = ... + name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = '' ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/stdlib/smtpd.pyi b/stdlib/smtpd.pyi index a83e827bfc76..7392bd51627d 100644 --- a/stdlib/smtpd.pyi +++ b/stdlib/smtpd.pyi @@ -41,7 +41,7 @@ class SMTPChannel(asynchat.async_chat): server: SMTPServer, conn: socket.socket, addr: Any, - data_size_limit: int = ..., + data_size_limit: int = 33554432, map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, @@ -71,7 +71,7 @@ class SMTPServer(asyncore.dispatcher): self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = ..., + data_size_limit: int = 33554432, map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index 8325a4c79677..b4642aa587a4 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -122,7 +122,7 @@ class SMTP: password: str def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = True) -> _Reply: ... @overload - def auth_cram_md5(self, challenge: None = ...) -> None: ... + def auth_cram_md5(self, challenge: None = None) -> None: ... @overload def auth_cram_md5(self, challenge: ReadableBuffer) -> str: ... def auth_plain(self, challenge: ReadableBuffer | None = None) -> str: ... diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 41f3e7d3da9b..08ffbe966b6d 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -669,39 +669,39 @@ class socket(_socket.socket): mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: Literal[0], *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> SocketIO: ... @overload def makefile( self, mode: Literal["rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedRWPair: ... @overload def makefile( self, mode: Literal["rb", "br"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedReader: ... @overload def makefile( self, mode: Literal["wb", "bw"], - buffering: Literal[-1, 1] | None = ..., + buffering: Literal[-1, 1] | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> BufferedWriter: ... @overload def makefile( @@ -709,19 +709,19 @@ class socket(_socket.socket): mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], buffering: int, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> IOBase: ... @overload def makefile( self, - mode: Literal["r", "w", "rw", "wr", ""] = ..., - buffering: int | None = ..., + mode: Literal["r", "w", "rw", "wr", ""] = 'r', + buffering: int | None = None, *, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., + encoding: str | None = None, + errors: str | None = None, + newline: str | None = None, ) -> TextIOWrapper: ... def sendfile(self, file: _SendableFile, offset: int = 0, count: int | None = None) -> int: ... @property @@ -744,7 +744,7 @@ if sys.platform == "win32": def fromshare(info: bytes) -> socket: ... if sys.platform == "win32": - def socketpair(family: int = ..., type: int = ..., proto: int = ...) -> tuple[socket, socket]: ... + def socketpair(family: int = ..., type: int = ..., proto: int = 0) -> tuple[socket, socket]: ... else: def socketpair( @@ -773,7 +773,7 @@ if sys.version_info >= (3, 11): else: def create_connection( - address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = ... # noqa: F811 + address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = None # noqa: F811 ) -> socket: ... if sys.version_info >= (3, 8): diff --git a/stdlib/socketserver.pyi b/stdlib/socketserver.pyi index b593e77c5f23..b35f1553fb44 100644 --- a/stdlib/socketserver.pyi +++ b/stdlib/socketserver.pyi @@ -52,7 +52,7 @@ class BaseServer: def RequestHandlerClass(self: Self, val: Callable[[Any, _RetAddress, Self], BaseRequestHandler]) -> None: ... def fileno(self) -> int: ... def handle_request(self) -> None: ... - def serve_forever(self, poll_interval: float = ...) -> None: ... + def serve_forever(self, poll_interval: float = 0.5) -> None: ... def shutdown(self) -> None: ... def server_close(self) -> None: ... def finish_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... diff --git a/stdlib/sqlite3/dbapi2.pyi b/stdlib/sqlite3/dbapi2.pyi index d018c2dd5532..ac72c69ba97d 100644 --- a/stdlib/sqlite3/dbapi2.pyi +++ b/stdlib/sqlite3/dbapi2.pyi @@ -349,7 +349,7 @@ class Connection: pages: int = -1, progress: Callable[[int, int, int], object] | None = None, name: str = "main", - sleep: float = ..., + sleep: float = 0.25, ) -> None: ... if sys.version_info >= (3, 11): def setlimit(self, __category: int, __limit: int) -> int: ... diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 6fd967ae5b9d..164fd8545bd7 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -324,7 +324,7 @@ class SSLSocket(socket.socket): def send(self, data: ReadableBuffer, flags: int = 0) -> int: ... def sendall(self, data: ReadableBuffer, flags: int = 0) -> None: ... @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = ...) -> int: ... + def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = None) -> int: ... @overload def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... def shutdown(self, how: int) -> None: ... @@ -332,7 +332,7 @@ class SSLSocket(socket.socket): def write(self, data: ReadableBuffer) -> int: ... def do_handshake(self, block: bool = False) -> None: ... # block is undocumented @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload @@ -380,7 +380,7 @@ class SSLContext: post_handshake_auth: bool if sys.version_info >= (3, 10): security_level: int - def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ... + def __new__(cls: type[Self], protocol: int = None, *args: Any, **kwargs: Any) -> Self: ... def cert_store_stats(self) -> dict[str, int]: ... def load_cert_chain( self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None @@ -393,11 +393,11 @@ class SSLContext: cadata: str | ReadableBuffer | None = None, ) -> None: ... @overload - def get_ca_certs(self, binary_form: Literal[False] = ...) -> list[_PeerCertRetDictType]: ... + def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ... @overload def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ... @overload - def get_ca_certs(self, binary_form: bool = ...) -> Any: ... + def get_ca_certs(self, binary_form: bool = False) -> Any: ... def get_ciphers(self) -> list[_Cipher]: ... def set_default_verify_paths(self) -> None: ... def set_ciphers(self, __cipherlist: str) -> None: ... @@ -438,7 +438,7 @@ class SSLObject: def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... def write(self, data: ReadableBuffer) -> int: ... @overload - def getpeercert(self, binary_form: Literal[False] = ...) -> _PeerCertRetDictType | None: ... + def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... @overload def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... @overload diff --git a/stdlib/statistics.pyi b/stdlib/statistics.pyi index 99dba9a58217..7f635dd37678 100644 --- a/stdlib/statistics.pyi +++ b/stdlib/statistics.pyi @@ -61,7 +61,7 @@ if sys.version_info >= (3, 11): def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = ...) -> float: ... else: - def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT | float: ... + def median_grouped(data: Iterable[_NumberT], interval: _NumberT = 1) -> _NumberT | float: ... def mode(data: Iterable[_HashableT]) -> _HashableT: ... @@ -81,7 +81,7 @@ def variance(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT if sys.version_info >= (3, 8): class NormalDist: - def __init__(self, mu: float = ..., sigma: float = ...) -> None: ... + def __init__(self, mu: float = 0.0, sigma: float = 1.0) -> None: ... @property def mean(self) -> float: ... @property diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index a417f34b074e..a9953a8eafc2 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -326,13 +326,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -359,13 +359,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -392,13 +392,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -426,13 +426,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -459,13 +459,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -492,13 +492,13 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -926,7 +926,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -1314,7 +1314,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1344,7 +1344,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1374,7 +1374,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1405,7 +1405,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1435,7 +1435,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1465,7 +1465,7 @@ elif sys.version_info >= (3, 10): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -2044,182 +2044,182 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, ) -> None: ... elif sys.version_info >= (3, 9): # user, group, extra_groups, umask were added in 3.9 @@ -2587,12 +2587,12 @@ if sys.platform == "win32": def __init__( self, *, - dwFlags: int = ..., - hStdInput: Any | None = ..., - hStdOutput: Any | None = ..., - hStdError: Any | None = ..., - wShowWindow: int = ..., - lpAttributeList: Mapping[str, Any] | None = ..., + dwFlags: int = 0, + hStdInput: Any | None = None, + hStdOutput: Any | None = None, + hStdError: Any | None = None, + wShowWindow: int = 0, + lpAttributeList: Mapping[str, Any] | None = None, ) -> None: ... dwFlags: int hStdInput: Any | None diff --git a/stdlib/sunau.pyi b/stdlib/sunau.pyi index bae55f645854..7702443b0c1c 100644 --- a/stdlib/sunau.pyi +++ b/stdlib/sunau.pyi @@ -78,7 +78,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Au_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Au_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/stdlib/sysconfig.pyi b/stdlib/sysconfig.pyi index 7e29cf1326d6..a2ad309aca7f 100644 --- a/stdlib/sysconfig.pyi +++ b/stdlib/sysconfig.pyi @@ -28,8 +28,8 @@ if sys.version_info >= (3, 10): def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... def get_path_names() -> tuple[str, ...]: ... -def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... -def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... +def get_path(name: str, scheme: str = 'nt', vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... +def get_paths(scheme: str = 'nt', vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... def get_python_version() -> str: ... def get_platform() -> str: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 656d024761c0..9d07640feefc 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -186,9 +186,9 @@ class TarFile: def gzopen( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _GzipReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = 'r', + fileobj: _GzipReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -205,8 +205,8 @@ class TarFile: cls: type[Self], name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _GzipWritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _GzipWritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -223,8 +223,8 @@ class TarFile: cls: type[Self], name: StrOrBytesPath | None, mode: Literal["w", "x"], - fileobj: _Bz2WritableFileobj | None = ..., - compresslevel: int = ..., + fileobj: _Bz2WritableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., @@ -240,9 +240,9 @@ class TarFile: def bz2open( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = ..., - fileobj: _Bz2ReadableFileobj | None = ..., - compresslevel: int = ..., + mode: Literal["r"] = 'r', + fileobj: _Bz2ReadableFileobj | None = None, + compresslevel: int = 9, *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 49162c444c78..e7a22def2020 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -37,41 +37,41 @@ if sys.version_info >= (3, 8): @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, *, - errors: str | None = ..., + errors: str | None = None, ) -> _TemporaryFileWrapper[Any]: ... else: @@ -235,44 +235,44 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., - mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _StrMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: str = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, *, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @property def errors(self) -> str | None: ... @@ -355,18 +355,18 @@ class TemporaryDirectory(Generic[AnyStr]): @overload def __init__( self: TemporaryDirectory[str], - suffix: str | None = ..., - prefix: str | None = ..., - dir: StrPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: str | None = None, + prefix: str | None = None, + dir: StrPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... @overload def __init__( self: TemporaryDirectory[bytes], - suffix: bytes | None = ..., - prefix: bytes | None = ..., - dir: BytesPath | None = ..., - ignore_cleanup_errors: bool = ..., + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, + ignore_cleanup_errors: bool = False, ) -> None: ... else: @overload @@ -387,18 +387,18 @@ class TemporaryDirectory(Generic[AnyStr]): # The overloads overlap, but they should still work fine. @overload def mkstemp( # type: ignore[misc] - suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ..., text: bool = ... + suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False ) -> tuple[int, str]: ... @overload def mkstemp( - suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ..., text: bool = ... + suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None, text: bool = False ) -> tuple[int, bytes]: ... # The overloads overlap, but they should still work fine. @overload -def mkdtemp(suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ...) -> str: ... # type: ignore[misc] +def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... # type: ignore[misc] @overload -def mkdtemp(suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ...) -> bytes: ... +def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ... def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ... def gettempdirb() -> bytes: ... def gettempprefixb() -> bytes: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 699dfd2a408a..7982d18f2317 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -269,7 +269,7 @@ def NoDefaultRoot() -> None: ... _TraceMode: TypeAlias = Literal["array", "read", "write", "unset"] class Variable: - def __init__(self, master: Misc | None = ..., value: Incomplete | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: Incomplete | None = None, name: str | None = None) -> None: ... def set(self, value) -> None: ... initialize = set def get(self): ... @@ -283,30 +283,30 @@ class Variable: def __eq__(self, other: object) -> bool: ... class StringVar(Variable): - def __init__(self, master: Misc | None = ..., value: str | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: str | None = None, name: str | None = None) -> None: ... def set(self, value: str) -> None: ... initialize = set def get(self) -> str: ... class IntVar(Variable): - def __init__(self, master: Misc | None = ..., value: int | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: int | None = None, name: str | None = None) -> None: ... def set(self, value: int) -> None: ... initialize = set def get(self) -> int: ... class DoubleVar(Variable): - def __init__(self, master: Misc | None = ..., value: float | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: float | None = None, name: str | None = None) -> None: ... def set(self, value: float) -> None: ... initialize = set def get(self) -> float: ... class BooleanVar(Variable): - def __init__(self, master: Misc | None = ..., value: bool | None = ..., name: str | None = ...) -> None: ... + def __init__(self, master: Misc | None = None, value: bool | None = None, name: str | None = None) -> None: ... def set(self, value: bool) -> None: ... initialize = set def get(self) -> bool: ... -def mainloop(n: int = ...) -> None: ... +def mainloop(n: int = 0) -> None: ... getint: Incomplete getdouble: Incomplete @@ -325,15 +325,15 @@ class Misc: children: dict[str, Widget] def destroy(self) -> None: ... def deletecommand(self, name: str) -> None: ... - def tk_strictMotif(self, boolean: Incomplete | None = ...): ... + def tk_strictMotif(self, boolean: Incomplete | None = None): ... def tk_bisque(self) -> None: ... def tk_setPalette(self, *args, **kw) -> None: ... - def wait_variable(self, name: str | Variable = ...) -> None: ... + def wait_variable(self, name: str | Variable = 'PY_VAR') -> None: ... waitvar = wait_variable - def wait_window(self, window: Misc | None = ...) -> None: ... - def wait_visibility(self, window: Misc | None = ...) -> None: ... - def setvar(self, name: str = ..., value: str = ...) -> None: ... - def getvar(self, name: str = ...): ... + def wait_window(self, window: Misc | None = None) -> None: ... + def wait_visibility(self, window: Misc | None = None) -> None: ... + def setvar(self, name: str = 'PY_VAR', value: str = '1') -> None: ... + def getvar(self, name: str = 'PY_VAR'): ... def getint(self, s): ... def getdouble(self, s): ... def getboolean(self, s): ... @@ -347,13 +347,13 @@ class Misc: def tk_focusNext(self) -> Misc | None: ... def tk_focusPrev(self) -> Misc | None: ... @overload - def after(self, ms: int, func: None = ...) -> None: ... + def after(self, ms: int, func: None = None) -> None: ... @overload def after(self, ms: int | Literal["idle"], func: Callable[..., object], *args: Any) -> str: ... # after_idle is essentially partialmethod(after, "idle") def after_idle(self, func: Callable[..., object], *args: Any) -> str: ... def after_cancel(self, id: str) -> None: ... - def bell(self, displayof: Literal[0] | Misc | None = ...) -> None: ... + def bell(self, displayof: Literal[0] | Misc | None = 0) -> None: ... def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ... def clipboard_clear(self, *, displayof: Misc = ...) -> None: ... def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...) -> None: ... @@ -363,42 +363,42 @@ class Misc: def grab_set_global(self) -> None: ... def grab_status(self) -> Literal["local", "global"] | None: ... def option_add( - self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = ... + self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = None ) -> None: ... def option_clear(self) -> None: ... def option_get(self, name, className): ... - def option_readfile(self, fileName, priority: Incomplete | None = ...) -> None: ... + def option_readfile(self, fileName, priority: Incomplete | None = None) -> None: ... def selection_clear(self, **kw) -> None: ... def selection_get(self, **kw): ... def selection_handle(self, command, **kw) -> None: ... def selection_own(self, **kw) -> None: ... def selection_own_get(self, **kw): ... def send(self, interp, cmd, *args): ... - def lower(self, belowThis: Incomplete | None = ...) -> None: ... - def tkraise(self, aboveThis: Incomplete | None = ...) -> None: ... + def lower(self, belowThis: Incomplete | None = None) -> None: ... + def tkraise(self, aboveThis: Incomplete | None = None) -> None: ... lift = tkraise if sys.version_info >= (3, 11): def info_patchlevel(self) -> _VersionInfoType: ... - def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = ...) -> int: ... - def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = ...) -> str: ... + def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ... + def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ... def winfo_cells(self) -> int: ... def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk def winfo_class(self) -> str: ... def winfo_colormapfull(self) -> bool: ... - def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = ...) -> Misc | None: ... + def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ... def winfo_depth(self) -> int: ... def winfo_exists(self) -> bool: ... def winfo_fpixels(self, number: _ScreenUnits) -> float: ... def winfo_geometry(self) -> str: ... def winfo_height(self) -> int: ... def winfo_id(self) -> int: ... - def winfo_interps(self, displayof: Literal[0] | Misc | None = ...) -> tuple[str, ...]: ... + def winfo_interps(self, displayof: Literal[0] | Misc | None = 0) -> tuple[str, ...]: ... def winfo_ismapped(self) -> bool: ... def winfo_manager(self) -> str: ... def winfo_name(self) -> str: ... def winfo_parent(self) -> str: ... # return value needs nametowidget() - def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = ...): ... + def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = 0): ... def winfo_pixels(self, number: _ScreenUnits) -> int: ... def winfo_pointerx(self) -> int: ... def winfo_pointerxy(self) -> tuple[int, int]: ... @@ -421,7 +421,7 @@ class Misc: def winfo_viewable(self) -> bool: ... def winfo_visual(self) -> str: ... def winfo_visualid(self) -> str: ... - def winfo_visualsavailable(self, includeids: int = ...) -> list[tuple[str, int]]: ... + def winfo_visualsavailable(self, includeids: int = False) -> list[tuple[str, int]]: ... def winfo_vrootheight(self) -> int: ... def winfo_vrootwidth(self) -> int: ... def winfo_vrootx(self) -> int: ... @@ -432,7 +432,7 @@ class Misc: def update(self) -> None: ... def update_idletasks(self) -> None: ... @overload - def bindtags(self, tagList: None = ...) -> tuple[str, ...]: ... + def bindtags(self, tagList: None = None) -> tuple[str, ...]: ... @overload def bindtags(self, tagList: list[str] | tuple[str, ...]) -> None: ... # bind with isinstance(func, str) doesn't return anything, but all other @@ -440,49 +440,49 @@ class Misc: @overload def bind( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... # There's no way to know what type of widget bind_all and bind_class # callbacks will get, so those are Misc. @overload def bind_all( self, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload def bind_class( self, className: str, - sequence: str | None = ..., - func: Callable[[Event[Misc]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Misc]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def unbind(self, sequence: str, funcid: str | None = ...) -> None: ... + def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def unbind(self, sequence: str, funcid: str | None = None) -> None: ... def unbind_all(self, sequence: str) -> None: ... def unbind_class(self, className: str, sequence: str) -> None: ... - def mainloop(self, n: int = ...) -> None: ... + def mainloop(self, n: int = 0) -> None: ... def quit(self) -> None: ... @property def _windowingsystem(self) -> Literal["win32", "aqua", "x11"]: ... def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ... def register( - self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = ..., needcleanup: int = ... + self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = None, needcleanup: int = 1 ) -> str: ... def keys(self) -> list[str]: ... @overload @@ -490,14 +490,14 @@ class Misc: @overload def pack_propagate(self) -> None: ... propagate = pack_propagate - def grid_anchor(self, anchor: _Anchor | None = ...) -> None: ... + def grid_anchor(self, anchor: _Anchor | None = None) -> None: ... anchor = grid_anchor @overload def grid_bbox( - self, column: None = ..., row: None = ..., col2: None = ..., row2: None = ... + self, column: None = None, row: None = None, col2: None = None, row2: None = None ) -> tuple[int, int, int, int] | None: ... @overload - def grid_bbox(self, column: int, row: int, col2: None = ..., row2: None = ...) -> tuple[int, int, int, int] | None: ... + def grid_bbox(self, column: int, row: int, col2: None = None, row2: None = None) -> tuple[int, int, int, int] | None: ... @overload def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ... bbox = grid_bbox @@ -532,7 +532,7 @@ class Misc: size = grid_size # Widget because Toplevel or Tk is never a slave def pack_slaves(self) -> list[Widget]: ... - def grid_slaves(self, row: int | None = ..., column: int | None = ...) -> list[Widget]: ... + def grid_slaves(self, row: int | None = None, column: int | None = None) -> list[Widget]: ... def place_slaves(self) -> list[Widget]: ... slaves = pack_slaves def event_add(self, virtual: str, *sequences: str) -> None: ... @@ -569,14 +569,14 @@ class Misc: x: _ScreenUnits = ..., y: _ScreenUnits = ..., ) -> None: ... - def event_info(self, virtual: str | None = ...) -> tuple[str, ...]: ... + def event_info(self, virtual: str | None = None) -> tuple[str, ...]: ... def image_names(self) -> tuple[str, ...]: ... def image_types(self) -> tuple[str, ...]: ... # See #4363 and #4891 def __setitem__(self, key: str, value: Any) -> None: ... def __getitem__(self, key: str) -> Any: ... def cget(self, key: str) -> Any: ... - def configure(self, cnf: Any = ...) -> Any: ... + def configure(self, cnf: Any = None) -> Any: ... # TODO: config is an alias of configure, but adding that here creates lots of mypy errors class CallWrapper: @@ -613,7 +613,7 @@ class Wm: def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ... @overload def wm_aspect( - self, minNumer: None = ..., minDenom: None = ..., maxNumer: None = ..., maxDenom: None = ... + self, minNumer: None = None, minDenom: None = None, maxNumer: None = None, maxDenom: None = None ) -> tuple[int, int, int, int] | None: ... aspect = wm_aspect @overload @@ -623,7 +623,7 @@ class Wm: @overload def wm_attributes(self, __option: str, __value, *__other_option_value_pairs: Any) -> None: ... attributes = wm_attributes - def wm_client(self, name: str | None = ...) -> str: ... + def wm_client(self, name: str | None = None) -> str: ... client = wm_client @overload def wm_colormapwindows(self) -> list[Misc]: ... @@ -632,91 +632,91 @@ class Wm: @overload def wm_colormapwindows(self, __first_wlist_item: Misc, *other_wlist_items: Misc) -> None: ... colormapwindows = wm_colormapwindows - def wm_command(self, value: str | None = ...) -> str: ... + def wm_command(self, value: str | None = None) -> str: ... command = wm_command # Some of these always return empty string, but return type is set to None to prevent accidentally using it def wm_deiconify(self) -> None: ... deiconify = wm_deiconify - def wm_focusmodel(self, model: Literal["active", "passive"] | None = ...) -> Literal["active", "passive", ""]: ... + def wm_focusmodel(self, model: Literal["active", "passive"] | None = None) -> Literal["active", "passive", ""]: ... focusmodel = wm_focusmodel def wm_forget(self, window: Wm) -> None: ... forget = wm_forget def wm_frame(self) -> str: ... frame = wm_frame @overload - def wm_geometry(self, newGeometry: None = ...) -> str: ... + def wm_geometry(self, newGeometry: None = None) -> str: ... @overload def wm_geometry(self, newGeometry: str) -> None: ... geometry = wm_geometry def wm_grid( self, - baseWidth: Incomplete | None = ..., - baseHeight: Incomplete | None = ..., - widthInc: Incomplete | None = ..., - heightInc: Incomplete | None = ..., + baseWidth: Incomplete | None = None, + baseHeight: Incomplete | None = None, + widthInc: Incomplete | None = None, + heightInc: Incomplete | None = None, ): ... grid = wm_grid - def wm_group(self, pathName: Incomplete | None = ...): ... + def wm_group(self, pathName: Incomplete | None = None): ... group = wm_group - def wm_iconbitmap(self, bitmap: Incomplete | None = ..., default: Incomplete | None = ...): ... + def wm_iconbitmap(self, bitmap: Incomplete | None = None, default: Incomplete | None = None): ... iconbitmap = wm_iconbitmap def wm_iconify(self) -> None: ... iconify = wm_iconify - def wm_iconmask(self, bitmap: Incomplete | None = ...): ... + def wm_iconmask(self, bitmap: Incomplete | None = None): ... iconmask = wm_iconmask - def wm_iconname(self, newName: Incomplete | None = ...) -> str: ... + def wm_iconname(self, newName: Incomplete | None = None) -> str: ... iconname = wm_iconname def wm_iconphoto(self, default: bool, __image1: Image, *args: Image) -> None: ... iconphoto = wm_iconphoto - def wm_iconposition(self, x: int | None = ..., y: int | None = ...) -> tuple[int, int] | None: ... + def wm_iconposition(self, x: int | None = None, y: int | None = None) -> tuple[int, int] | None: ... iconposition = wm_iconposition - def wm_iconwindow(self, pathName: Incomplete | None = ...): ... + def wm_iconwindow(self, pathName: Incomplete | None = None): ... iconwindow = wm_iconwindow def wm_manage(self, widget) -> None: ... manage = wm_manage @overload - def wm_maxsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_maxsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_maxsize(self, width: int, height: int) -> None: ... maxsize = wm_maxsize @overload - def wm_minsize(self, width: None = ..., height: None = ...) -> tuple[int, int]: ... + def wm_minsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... @overload def wm_minsize(self, width: int, height: int) -> None: ... minsize = wm_minsize @overload - def wm_overrideredirect(self, boolean: None = ...) -> bool | None: ... # returns True or None + def wm_overrideredirect(self, boolean: None = None) -> bool | None: ... # returns True or None @overload def wm_overrideredirect(self, boolean: bool) -> None: ... overrideredirect = wm_overrideredirect - def wm_positionfrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_positionfrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... positionfrom = wm_positionfrom @overload def wm_protocol(self, name: str, func: Callable[[], object] | str) -> None: ... @overload - def wm_protocol(self, name: str, func: None = ...) -> str: ... + def wm_protocol(self, name: str, func: None = None) -> str: ... @overload - def wm_protocol(self, name: None = ..., func: None = ...) -> tuple[str, ...]: ... + def wm_protocol(self, name: None = None, func: None = None) -> tuple[str, ...]: ... protocol = wm_protocol @overload - def wm_resizable(self, width: None = ..., height: None = ...) -> tuple[bool, bool]: ... + def wm_resizable(self, width: None = None, height: None = None) -> tuple[bool, bool]: ... @overload def wm_resizable(self, width: bool, height: bool) -> None: ... resizable = wm_resizable - def wm_sizefrom(self, who: Literal["program", "user"] | None = ...) -> Literal["", "program", "user"]: ... + def wm_sizefrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... sizefrom = wm_sizefrom @overload - def wm_state(self, newstate: None = ...) -> str: ... + def wm_state(self, newstate: None = None) -> str: ... @overload def wm_state(self, newstate: str) -> None: ... state = wm_state @overload - def wm_title(self, string: None = ...) -> str: ... + def wm_title(self, string: None = None) -> str: ... @overload def wm_title(self, string: str) -> None: ... title = wm_title @overload - def wm_transient(self, master: None = ...) -> _tkinter.Tcl_Obj: ... + def wm_transient(self, master: None = None) -> _tkinter.Tcl_Obj: ... @overload def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ... transient = wm_transient @@ -733,17 +733,17 @@ class Tk(Misc, Wm): # args. # use `git grep screenName` to find them self, - screenName: str | None = ..., - baseName: str | None = ..., - className: str = ..., - useTk: bool = ..., - sync: bool = ..., - use: str | None = ..., + screenName: str | None = None, + baseName: str | None = None, + className: str = 'Tk', + useTk: bool = True, + sync: bool = False, + use: str | None = None, ) -> None: ... @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -800,7 +800,7 @@ class Tk(Misc, Wm): def wantobjects(self, *args, **kwargs): ... def willdispatch(self): ... -def Tcl(screenName: str | None = ..., baseName: str | None = ..., className: str = ..., useTk: bool = ...) -> Tk: ... +def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = 'Tk', useTk: bool = False) -> Tk: ... _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) @@ -931,14 +931,14 @@ class Widget(BaseWidget, Pack, Place, Grid): @overload def bind( self: _W, - sequence: str | None = ..., - func: Callable[[Event[_W]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[_W]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... + def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... class Toplevel(BaseWidget, Wm): # Toplevel and Tk have the same options because they correspond to the same @@ -946,7 +946,7 @@ class Toplevel(BaseWidget, Wm): # copy/pasted here instead of aliasing as 'config = Tk.config'. def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -976,7 +976,7 @@ class Toplevel(BaseWidget, Wm): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1002,7 +1002,7 @@ class Toplevel(BaseWidget, Wm): class Button(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1051,7 +1051,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1099,7 +1099,7 @@ class Button(Widget): class Canvas(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1142,7 +1142,7 @@ class Canvas(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1187,8 +1187,8 @@ class Canvas(Widget, XView, YView): newtag: str, x: _ScreenUnits, y: _ScreenUnits, - halo: _ScreenUnits | None = ..., - start: str | _CanvasItemId | None = ..., + halo: _ScreenUnits | None = None, + start: str | _CanvasItemId | None = None, ) -> None: ... def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... @@ -1198,7 +1198,7 @@ class Canvas(Widget, XView, YView): def find_all(self) -> tuple[_CanvasItemId, ...]: ... def find_below(self, tagOrId: str | _CanvasItemId) -> tuple[_CanvasItemId, ...]: ... def find_closest( - self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = ..., start: str | _CanvasItemId | None = ... + self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | _CanvasItemId | None = None ) -> tuple[_CanvasItemId, ...]: ... def find_enclosed( self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits @@ -1211,19 +1211,19 @@ class Canvas(Widget, XView, YView): def tag_bind( self, tagOrId: str | _CanvasItemId, - sequence: str | None = ..., - func: Callable[[Event[Canvas]], object] | None = ..., - add: Literal["", "+"] | bool | None = ..., + sequence: str | None = None, + func: Callable[[Event[Canvas]], object] | None = None, + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload def tag_bind( - self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ... + self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None ) -> None: ... @overload - def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = ...) -> None: ... - def canvasx(self, screenx, gridspacing: Incomplete | None = ...): ... - def canvasy(self, screeny, gridspacing: Incomplete | None = ...): ... + def tag_bind(self, tagOrId: str | _CanvasItemId, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagOrId: str | _CanvasItemId, sequence: str, funcid: str | None = None) -> None: ... + def canvasx(self, screenx, gridspacing: Incomplete | None = None): ... + def canvasy(self, screeny, gridspacing: Incomplete | None = None): ... @overload def coords(self, __tagOrId: str | _CanvasItemId) -> list[float]: ... @overload @@ -1714,12 +1714,12 @@ class Canvas(Widget, XView, YView): def itemcget(self, tagOrId, option): ... # itemconfigure kwargs depend on item type, which is not known when type checking def itemconfigure( - self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = ..., **kw: Any + self, tagOrId: str | _CanvasItemId, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, str, str]] | None: ... itemconfig = itemconfigure def move(self, *args) -> None: ... if sys.version_info >= (3, 8): - def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = ..., y: Literal[""] | float = ...) -> None: ... + def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = '', y: Literal[""] | float = '') -> None: ... def postscript(self, cnf=..., **kw): ... # tkinter does: @@ -1734,7 +1734,7 @@ class Canvas(Widget, XView, YView): def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override] def scale(self, *args) -> None: ... def scan_mark(self, x, y) -> None: ... - def scan_dragto(self, x, y, gain: int = ...) -> None: ... + def scan_dragto(self, x, y, gain: int = 10) -> None: ... def select_adjust(self, tagOrId, index) -> None: ... def select_clear(self) -> None: ... def select_from(self, tagOrId, index) -> None: ... @@ -1745,7 +1745,7 @@ class Canvas(Widget, XView, YView): class Checkbutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -1805,7 +1805,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -1864,7 +1864,7 @@ _EntryIndex: TypeAlias = str | int # "INDICES" in manual page class Entry(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -1909,7 +1909,7 @@ class Entry(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -1952,7 +1952,7 @@ class Entry(Widget, XView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def delete(self, first: _EntryIndex, last: _EntryIndex | None = ...) -> None: ... + def delete(self, first: _EntryIndex, last: _EntryIndex | None = None) -> None: ... def get(self) -> str: ... def icursor(self, index: _EntryIndex) -> None: ... def index(self, index: _EntryIndex) -> int: ... @@ -1975,7 +1975,7 @@ class Entry(Widget, XView): class Frame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -2002,7 +2002,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -2027,7 +2027,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2066,7 +2066,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2107,7 +2107,7 @@ class Label(Widget): class Listbox(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activestyle: Literal["dotbox", "none", "underline"] = ..., @@ -2158,7 +2158,7 @@ class Listbox(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activestyle: Literal["dotbox", "none", "underline"] = ..., background: _Color = ..., @@ -2196,8 +2196,8 @@ class Listbox(Widget, XView, YView): def activate(self, index: str | int) -> None: ... def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override] def curselection(self): ... - def delete(self, first: str | int, last: str | int | None = ...) -> None: ... - def get(self, first: str | int, last: str | int | None = ...): ... + def delete(self, first: str | int, last: str | int | None = None) -> None: ... + def get(self, first: str | int, last: str | int | None = None): ... def index(self, index: str | int) -> int: ... def insert(self, index: str | int, *elements: str | float) -> None: ... def nearest(self, y): ... @@ -2206,21 +2206,21 @@ class Listbox(Widget, XView, YView): def see(self, index: str | int) -> None: ... def selection_anchor(self, index: str | int) -> None: ... select_anchor = selection_anchor - def selection_clear(self, first: str | int, last: str | int | None = ...) -> None: ... # type: ignore[override] + def selection_clear(self, first: str | int, last: str | int | None = None) -> None: ... # type: ignore[override] select_clear = selection_clear def selection_includes(self, index: str | int): ... select_includes = selection_includes - def selection_set(self, first: str | int, last: str | int | None = ...) -> None: ... + def selection_set(self, first: str | int, last: str | int | None = None) -> None: ... select_set = selection_set def size(self) -> int: ... # type: ignore[override] def itemcget(self, index: str | int, option): ... - def itemconfigure(self, index: str | int, cnf: Incomplete | None = ..., **kw): ... + def itemconfigure(self, index: str | int, cnf: Incomplete | None = None, **kw): ... itemconfig = itemconfigure class Menu(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2252,7 +2252,7 @@ class Menu(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeborderwidth: _ScreenUnits = ..., @@ -2279,7 +2279,7 @@ class Menu(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def tk_popup(self, x: int, y: int, entry: str | int = ...) -> None: ... + def tk_popup(self, x: int, y: int, entry: str | int = '') -> None: ... def activate(self, index: str | int) -> None: ... def add(self, itemType, cnf=..., **kw): ... # docstring says "Internal function." def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function." @@ -2473,10 +2473,10 @@ class Menu(Widget): variable: Variable = ..., ) -> None: ... def insert_separator(self, index: str | int, cnf: dict[str, Any] | None = ..., *, background: _Color = ...) -> None: ... - def delete(self, index1: str | int, index2: str | int | None = ...) -> None: ... + def delete(self, index1: str | int, index2: str | int | None = None) -> None: ... def entrycget(self, index: str | int, option: str) -> Any: ... def entryconfigure( - self, index: str | int, cnf: dict[str, Any] | None = ..., **kw: Any + self, index: str | int, cnf: dict[str, Any] | None = None, **kw: Any ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... entryconfig = entryconfigure def index(self, index: str | int) -> int | None: ... @@ -2490,7 +2490,7 @@ class Menu(Widget): class Menubutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2532,7 +2532,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2576,7 +2576,7 @@ class Menubutton(Widget): class Message(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, anchor: _Anchor = ..., @@ -2607,7 +2607,7 @@ class Message(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: _Anchor = ..., aspect: int = ..., @@ -2639,7 +2639,7 @@ class Message(Widget): class Radiobutton(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2688,7 +2688,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activeforeground: _Color = ..., @@ -2743,7 +2743,7 @@ class Radiobutton(Widget): class Scale(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2786,7 +2786,7 @@ class Scale(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -2828,13 +2828,13 @@ class Scale(Widget): config = configure def get(self) -> float: ... def set(self, value) -> None: ... - def coords(self, value: float | None = ...) -> tuple[int, int]: ... + def coords(self, value: float | None = None) -> tuple[int, int]: ... def identify(self, x, y) -> Literal["", "slider", "trough1", "trough2"]: ... class Scrollbar(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -2867,7 +2867,7 @@ class Scrollbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., activerelief: _Relief = ..., @@ -2894,7 +2894,7 @@ class Scrollbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def activate(self, index: Incomplete | None = ...): ... + def activate(self, index: Incomplete | None = None): ... def delta(self, deltax: int, deltay: int) -> float: ... def fraction(self, x: int, y: int) -> float: ... def identify(self, x: int, y: int) -> Literal["arrow1", "arrow2", "slider", "trough1", "trough2", ""]: ... @@ -2906,7 +2906,7 @@ _TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc class Text(Widget, XView, YView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, autoseparators: bool = ..., @@ -2963,7 +2963,7 @@ class Text(Widget, XView, YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, autoseparators: bool = ..., background: _Color = ..., @@ -3018,17 +3018,17 @@ class Text(Widget, XView, YView): def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ... def count(self, index1, index2, *args): ... # TODO @overload - def debug(self, boolean: None = ...) -> bool: ... + def debug(self, boolean: None = None) -> bool: ... @overload def debug(self, boolean: bool) -> None: ... - def delete(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ... @overload def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., - command: None = ..., + index2: _TextIndex | None = None, + command: None = None, *, all: bool = ..., image: bool = ..., @@ -3055,7 +3055,7 @@ class Text(Widget, XView, YView): def dump( self, index1: _TextIndex, - index2: _TextIndex | None = ..., + index2: _TextIndex | None = None, *, command: Callable[[str, str, str], object] | str, all: bool = ..., @@ -3067,23 +3067,23 @@ class Text(Widget, XView, YView): ) -> None: ... def edit(self, *args): ... # docstring says "Internal method" @overload - def edit_modified(self, arg: None = ...) -> bool: ... # actually returns Literal[0, 1] + def edit_modified(self, arg: None = None) -> bool: ... # actually returns Literal[0, 1] @overload def edit_modified(self, arg: bool) -> None: ... # actually returns empty string def edit_redo(self) -> None: ... # actually returns empty string def edit_reset(self) -> None: ... # actually returns empty string def edit_separator(self) -> None: ... # actually returns empty string def edit_undo(self) -> None: ... # actually returns empty string - def get(self, index1: _TextIndex, index2: _TextIndex | None = ...) -> str: ... + def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ... # TODO: image_* methods def image_cget(self, index, option): ... - def image_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def image_configure(self, index, cnf: Incomplete | None = None, **kw): ... def image_create(self, index, cnf=..., **kw): ... def image_names(self): ... def index(self, index: _TextIndex) -> str: ... def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ... @overload - def mark_gravity(self, markName: str, direction: None = ...) -> Literal["left", "right"]: ... + def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ... @overload def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string def mark_names(self) -> tuple[str, ...]: ... @@ -3101,14 +3101,14 @@ class Text(Widget, XView, YView): self, pattern: str, index: _TextIndex, - stopindex: _TextIndex | None = ..., - forwards: bool | None = ..., - backwards: bool | None = ..., - exact: bool | None = ..., - regexp: bool | None = ..., - nocase: bool | None = ..., - count: Variable | None = ..., - elide: bool | None = ..., + stopindex: _TextIndex | None = None, + forwards: bool | None = None, + backwards: bool | None = None, + exact: bool | None = None, + regexp: bool | None = None, + nocase: bool | None = None, + count: Variable | None = None, + elide: bool | None = None, ) -> str: ... # returns empty string for not found def see(self, index: _TextIndex) -> None: ... def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ... @@ -3119,18 +3119,18 @@ class Text(Widget, XView, YView): tagName: str, sequence: str | None, func: Callable[[Event[Text]], object] | None, - add: Literal["", "+"] | bool | None = ..., + add: Literal["", "+"] | bool | None = None, ) -> str: ... @overload - def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = ...) -> None: ... - def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = ...) -> None: ... + def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... + def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = None) -> None: ... # allowing any string for cget instead of just Literals because there's no other way to look up tag options def tag_cget(self, tagName: str, option: str): ... @overload def tag_configure( self, tagName: str, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bgstipple: _Bitmap = ..., @@ -3165,24 +3165,24 @@ class Text(Widget, XView, YView): def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ... tag_config = tag_configure def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given - def tag_lower(self, tagName: str, belowThis: str | None = ...) -> None: ... - def tag_names(self, index: _TextIndex | None = ...) -> tuple[str, ...]: ... - def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> tuple[str, str] | tuple[()]: ... - def tag_raise(self, tagName: str, aboveThis: str | None = ...) -> None: ... + def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ... + def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ... + def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> tuple[str, str] | tuple[()]: ... + def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> tuple[str, str] | tuple[()]: ... + def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ... def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ... # tag_remove and tag_delete are different - def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = ...) -> None: ... + def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... # TODO: window_* methods def window_cget(self, index, option): ... - def window_configure(self, index, cnf: Incomplete | None = ..., **kw): ... + def window_configure(self, index, cnf: Incomplete | None = None, **kw): ... window_config = window_configure def window_create(self, index, cnf=..., **kw) -> None: ... def window_names(self): ... def yview_pickplace(self, *what): ... # deprecated class _setit: - def __init__(self, var, value, callback: Incomplete | None = ...) -> None: ... + def __init__(self, var, value, callback: Incomplete | None = None) -> None: ... def __call__(self, *args) -> None: ... # manual page: tk_optionMenu @@ -3211,7 +3211,7 @@ class Image: name: Incomplete tk: _tkinter.TkappType def __init__( - self, imgtype, name: Incomplete | None = ..., cnf=..., master: Misc | _tkinter.TkappType | None = ..., **kw + self, imgtype, name: Incomplete | None = None, cnf=..., master: Misc | _tkinter.TkappType | None = None, **kw ) -> None: ... def __del__(self) -> None: ... def __setitem__(self, key, value) -> None: ... @@ -3225,9 +3225,9 @@ class Image: class PhotoImage(Image): def __init__( self, - name: str | None = ..., + name: str | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, data: str | bytes = ..., # not same as data argument of put() format: str = ..., @@ -3253,8 +3253,8 @@ class PhotoImage(Image): def cget(self, option: str) -> str: ... def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0' def copy(self) -> PhotoImage: ... - def zoom(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... - def subsample(self, x: int, y: int | Literal[""] = ...) -> PhotoImage: ... + def zoom(self, x: int, y: int | Literal[""] = '') -> PhotoImage: ... + def subsample(self, x: int, y: int | Literal[""] = '') -> PhotoImage: ... def get(self, x: int, y: int) -> tuple[int, int, int]: ... def put( self, @@ -3267,9 +3267,9 @@ class PhotoImage(Image): | tuple[list[_Color], ...] | tuple[tuple[_Color, ...], ...] ), - to: tuple[int, int] | None = ..., + to: tuple[int, int] | None = None, ) -> None: ... - def write(self, filename: StrOrBytesPath, format: str | None = ..., from_coords: tuple[int, int] | None = ...) -> None: ... + def write(self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None) -> None: ... if sys.version_info >= (3, 8): def transparency_get(self, x: int, y: int) -> bool: ... def transparency_set(self, x: int, y: int, boolean: bool) -> None: ... @@ -3277,9 +3277,9 @@ class PhotoImage(Image): class BitmapImage(Image): def __init__( self, - name: Incomplete | None = ..., + name: Incomplete | None = None, cnf: dict[str, Any] = ..., - master: Misc | _tkinter.TkappType | None = ..., + master: Misc | _tkinter.TkappType | None = None, *, background: _Color = ..., data: str | bytes = ..., @@ -3295,7 +3295,7 @@ def image_types() -> tuple[str, ...]: ... class Spinbox(Widget, XView): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, activebackground: _Color = ..., @@ -3354,7 +3354,7 @@ class Spinbox(Widget, XView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, activebackground: _Color = ..., background: _Color = ..., @@ -3411,7 +3411,7 @@ class Spinbox(Widget, XView): def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure def bbox(self, index) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def delete(self, first, last: Incomplete | None = ...) -> Literal[""]: ... + def delete(self, first, last: Incomplete | None = None) -> Literal[""]: ... def get(self) -> str: ... def icursor(self, index): ... def identify(self, x: int, y: int) -> Literal["", "buttondown", "buttonup", "entry"]: ... @@ -3425,7 +3425,7 @@ class Spinbox(Widget, XView): def selection(self, *args) -> tuple[int, ...]: ... def selection_adjust(self, index): ... def selection_clear(self): ... - def selection_element(self, element: Incomplete | None = ...): ... + def selection_element(self, element: Incomplete | None = None): ... if sys.version_info >= (3, 8): def selection_from(self, index: int) -> None: ... def selection_present(self) -> None: ... @@ -3435,7 +3435,7 @@ class Spinbox(Widget, XView): class LabelFrame(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3469,7 +3469,7 @@ class LabelFrame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3500,7 +3500,7 @@ class LabelFrame(Widget): class PanedWindow(Widget): def __init__( self, - master: Misc | None = ..., + master: Misc | None = None, cnf: dict[str, Any] | None = ..., *, background: _Color = ..., @@ -3529,7 +3529,7 @@ class PanedWindow(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: _Color = ..., bd: _ScreenUnits = ..., @@ -3569,7 +3569,7 @@ class PanedWindow(Widget): def sash_mark(self, index): ... def sash_place(self, index, x, y): ... def panecget(self, child, option): ... - def paneconfigure(self, tagOrId, cnf: Incomplete | None = ..., **kw): ... + def paneconfigure(self, tagOrId, cnf: Incomplete | None = None, **kw): ... paneconfig: Incomplete def panes(self): ... diff --git a/stdlib/tkinter/colorchooser.pyi b/stdlib/tkinter/colorchooser.pyi index 47eb222590c6..d93a059f4144 100644 --- a/stdlib/tkinter/colorchooser.pyi +++ b/stdlib/tkinter/colorchooser.pyi @@ -11,7 +11,7 @@ class Chooser(Dialog): if sys.version_info >= (3, 9): def askcolor( - color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... ) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ... else: diff --git a/stdlib/tkinter/commondialog.pyi b/stdlib/tkinter/commondialog.pyi index edae62582237..eba3ab5be3bd 100644 --- a/stdlib/tkinter/commondialog.pyi +++ b/stdlib/tkinter/commondialog.pyi @@ -10,5 +10,5 @@ class Dialog: command: ClassVar[str | None] master: Incomplete | None options: Mapping[str, Incomplete] - def __init__(self, master: Incomplete | None = ..., **options: Incomplete) -> None: ... + def __init__(self, master: Incomplete | None = None, **options: Incomplete) -> None: ... def show(self, **options: Incomplete) -> Incomplete: ... diff --git a/stdlib/tkinter/dialog.pyi b/stdlib/tkinter/dialog.pyi index 032dac2c15a2..8825188c767e 100644 --- a/stdlib/tkinter/dialog.pyi +++ b/stdlib/tkinter/dialog.pyi @@ -12,5 +12,5 @@ DIALOG_ICON: str class Dialog(Widget): widgetName: str num: int - def __init__(self, master: Incomplete | None = ..., cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ... + def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = ..., **kw: Incomplete) -> None: ... def destroy(self) -> None: ... diff --git a/stdlib/tkinter/dnd.pyi b/stdlib/tkinter/dnd.pyi index ad7972968f81..4a6ab42b3e33 100644 --- a/stdlib/tkinter/dnd.pyi +++ b/stdlib/tkinter/dnd.pyi @@ -11,8 +11,8 @@ class _DndSource(Protocol): class DndHandler: root: ClassVar[Tk | None] def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... - def finish(self, event: Event[Misc] | None, commit: int = ...) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... + def finish(self, event: Event[Misc] | None, commit: int = 0) -> None: ... def on_motion(self, event: Event[Misc]) -> None: ... def on_release(self, event: Event[Misc]) -> None: ... diff --git a/stdlib/tkinter/filedialog.pyi b/stdlib/tkinter/filedialog.pyi index d0b7e451f72c..40c870a74152 100644 --- a/stdlib/tkinter/filedialog.pyi +++ b/stdlib/tkinter/filedialog.pyi @@ -41,21 +41,21 @@ class FileDialog: filter_button: Button cancel_button: Button def __init__( - self, master, title: Incomplete | None = ... + self, master, title: Incomplete | None = None ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either how: Incomplete | None - def go(self, dir_or_file=..., pattern: str = ..., default: str = ..., key: Incomplete | None = ...): ... - def quit(self, how: Incomplete | None = ...) -> None: ... + def go(self, dir_or_file='.', pattern: str = '*', default: str = '', key: Incomplete | None = None): ... + def quit(self, how: Incomplete | None = None) -> None: ... def dirs_double_event(self, event) -> None: ... def dirs_select_event(self, event) -> None: ... def files_double_event(self, event) -> None: ... def files_select_event(self, event) -> None: ... def ok_event(self, event) -> None: ... def ok_command(self) -> None: ... - def filter_command(self, event: Incomplete | None = ...) -> None: ... + def filter_command(self, event: Incomplete | None = None) -> None: ... def get_filter(self): ... def get_selection(self): ... - def cancel_command(self, event: Incomplete | None = ...) -> None: ... + def cancel_command(self, event: Incomplete | None = None) -> None: ... def set_filter(self, dir, pat) -> None: ... def set_selection(self, file) -> None: ... @@ -116,7 +116,7 @@ def askdirectory( # TODO: If someone actually uses these, overload to have the actual return type of open(..., mode) def asksaveasfile( - mode: str = ..., + mode: str = 'w', *, confirmoverwrite: bool | None = ..., defaultextension: str | None = ..., @@ -128,7 +128,7 @@ def asksaveasfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfile( - mode: str = ..., + mode: str = 'r', *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., @@ -139,7 +139,7 @@ def askopenfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfiles( - mode: str = ..., + mode: str = 'r', *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., diff --git a/stdlib/tkinter/font.pyi b/stdlib/tkinter/font.pyi index dff84e9fac78..0a557e921914 100644 --- a/stdlib/tkinter/font.pyi +++ b/stdlib/tkinter/font.pyi @@ -41,10 +41,10 @@ class Font: self, # In tkinter, 'root' refers to tkinter.Tk by convention, but the code # actually works with any tkinter widget so we use tkinter.Misc. - root: tkinter.Misc | None = ..., - font: _FontDescription | None = ..., - name: str | None = ..., - exists: bool = ..., + root: tkinter.Misc | None = None, + font: _FontDescription | None = None, + name: str | None = None, + exists: bool = False, *, family: str = ..., size: int = ..., @@ -68,19 +68,19 @@ class Font: def cget(self, option: str) -> Any: ... __getitem__ = cget @overload - def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = ...) -> str: ... + def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = None) -> str: ... @overload - def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = ...) -> int: ... + def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = None) -> int: ... @overload - def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = ...) -> Literal["normal", "bold"]: ... + def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = None) -> Literal["normal", "bold"]: ... @overload - def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = ...) -> Literal["roman", "italic"]: ... + def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = None) -> Literal["roman", "italic"]: ... @overload - def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = ...) -> bool: ... + def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = None) -> bool: ... @overload - def actual(self, option: None, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, option: None, displayof: tkinter.Misc | None = None) -> _FontDict: ... @overload - def actual(self, *, displayof: tkinter.Misc | None = ...) -> _FontDict: ... + def actual(self, *, displayof: tkinter.Misc | None = None) -> _FontDict: ... def config( self, *, @@ -99,14 +99,14 @@ class Font: def metrics(self, __option: Literal["fixed"], *, displayof: tkinter.Misc | None = ...) -> bool: ... @overload def metrics(self, *, displayof: tkinter.Misc | None = ...) -> _MetricsDict: ... - def measure(self, text: str, displayof: tkinter.Misc | None = ...) -> int: ... + def measure(self, text: str, displayof: tkinter.Misc | None = None) -> int: ... def __eq__(self, other: object) -> bool: ... -def families(root: tkinter.Misc | None = ..., displayof: tkinter.Misc | None = ...) -> tuple[str, ...]: ... -def names(root: tkinter.Misc | None = ...) -> tuple[str, ...]: ... +def families(root: tkinter.Misc | None = None, displayof: tkinter.Misc | None = None) -> tuple[str, ...]: ... +def names(root: tkinter.Misc | None = None) -> tuple[str, ...]: ... if sys.version_info >= (3, 10): - def nametofont(name: str, root: tkinter.Misc | None = ...) -> Font: ... + def nametofont(name: str, root: tkinter.Misc | None = None) -> Font: ... else: def nametofont(name: str) -> Font: ... diff --git a/stdlib/tkinter/messagebox.pyi b/stdlib/tkinter/messagebox.pyi index d99c588e3cd3..5a04b66d7866 100644 --- a/stdlib/tkinter/messagebox.pyi +++ b/stdlib/tkinter/messagebox.pyi @@ -34,11 +34,11 @@ NO: str class Message(Dialog): command: ClassVar[str] -def showinfo(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showwarning(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def showerror(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askquestion(title: str | None = ..., message: str | None = ..., **options) -> str: ... -def askokcancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesno(title: str | None = ..., message: str | None = ..., **options) -> bool: ... -def askyesnocancel(title: str | None = ..., message: str | None = ..., **options) -> bool | None: ... -def askretrycancel(title: str | None = ..., message: str | None = ..., **options) -> bool: ... +def showinfo(title: str | None = None, message: str | None = None, **options) -> str: ... +def showwarning(title: str | None = None, message: str | None = None, **options) -> str: ... +def showerror(title: str | None = None, message: str | None = None, **options) -> str: ... +def askquestion(title: str | None = None, message: str | None = None, **options) -> str: ... +def askokcancel(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesno(title: str | None = None, message: str | None = None, **options) -> bool: ... +def askyesnocancel(title: str | None = None, message: str | None = None, **options) -> bool | None: ... +def askretrycancel(title: str | None = None, message: str | None = None, **options) -> bool: ... diff --git a/stdlib/tkinter/scrolledtext.pyi b/stdlib/tkinter/scrolledtext.pyi index 4d8a7004c6b9..114f8c3de3ea 100644 --- a/stdlib/tkinter/scrolledtext.pyi +++ b/stdlib/tkinter/scrolledtext.pyi @@ -7,4 +7,4 @@ __all__ = ["ScrolledText"] class ScrolledText(Text): frame: Frame vbar: Scrollbar - def __init__(self, master: Misc | None = ..., **kwargs: Incomplete) -> None: ... + def __init__(self, master: Misc | None = None, **kwargs: Incomplete) -> None: ... diff --git a/stdlib/tkinter/simpledialog.pyi b/stdlib/tkinter/simpledialog.pyi index 8ae8b6d286d0..62eaf0f78175 100644 --- a/stdlib/tkinter/simpledialog.pyi +++ b/stdlib/tkinter/simpledialog.pyi @@ -1,11 +1,11 @@ from tkinter import Event, Frame, Misc, Toplevel class Dialog(Toplevel): - def __init__(self, parent: Misc | None, title: str | None = ...) -> None: ... + def __init__(self, parent: Misc | None, title: str | None = None) -> None: ... def body(self, master: Frame) -> Misc | None: ... def buttonbox(self) -> None: ... - def ok(self, event: Event[Misc] | None = ...) -> None: ... - def cancel(self, event: Event[Misc] | None = ...) -> None: ... + def ok(self, event: Event[Misc] | None = None) -> None: ... + def cancel(self, event: Event[Misc] | None = None) -> None: ... def validate(self) -> bool: ... def apply(self) -> None: ... @@ -13,12 +13,12 @@ class SimpleDialog: def __init__( self, master: Misc | None, - text: str = ..., + text: str = '', buttons: list[str] = ..., - default: int | None = ..., - cancel: int | None = ..., - title: str | None = ..., - class_: str | None = ..., + default: int | None = None, + cancel: int | None = None, + title: str | None = None, + class_: str | None = None, ) -> None: ... def go(self) -> int | None: ... def return_event(self, event: Event[Misc]) -> None: ... diff --git a/stdlib/tkinter/tix.pyi b/stdlib/tkinter/tix.pyi index db568bc4abef..05bd3fe4f513 100644 --- a/stdlib/tkinter/tix.pyi +++ b/stdlib/tkinter/tix.pyi @@ -38,22 +38,22 @@ TCL_ALL_EVENTS: Literal[0] class tixCommand: def tix_addbitmapdir(self, directory: str) -> None: ... def tix_cget(self, option: str) -> Any: ... - def tix_configure(self, cnf: dict[str, Any] | None = ..., **kw: Any) -> Any: ... - def tix_filedialog(self, dlgclass: str | None = ...) -> str: ... + def tix_configure(self, cnf: dict[str, Any] | None = None, **kw: Any) -> Any: ... + def tix_filedialog(self, dlgclass: str | None = None) -> str: ... def tix_getbitmap(self, name: str) -> str: ... def tix_getimage(self, name: str) -> str: ... def tix_option_get(self, name: str) -> Any: ... - def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = ...) -> None: ... + def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ... class Tk(tkinter.Tk, tixCommand): - def __init__(self, screenName: str | None = ..., baseName: str | None = ..., className: str = ...) -> None: ... + def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = 'Tix') -> None: ... class TixWidget(tkinter.Widget): def __init__( self, - master: tkinter.Misc | None = ..., - widgetName: str | None = ..., - static_options: list[str] | None = ..., + master: tkinter.Misc | None = None, + widgetName: str | None = None, + static_options: list[str] | None = None, cnf: dict[str, Any] = ..., kw: dict[str, Any] = ..., ) -> None: ... @@ -62,52 +62,52 @@ class TixWidget(tkinter.Widget): def subwidget(self, name: str) -> tkinter.Widget: ... def subwidgets_all(self) -> list[tkinter.Widget]: ... def config_all(self, option: Any, value: Any) -> None: ... - def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = ..., **kw) -> None: ... + def image_create(self, imgtype: str, cnf: dict[str, Any] = ..., master: tkinter.Widget | None = None, **kw) -> None: ... def image_delete(self, imgname: str) -> None: ... class TixSubWidget(TixWidget): def __init__( - self, master: tkinter.Widget, name: str, destroy_physically: int = ..., check_intermediate: int = ... + self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1 ) -> None: ... class DisplayStyle: - def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = ..., **kw) -> None: ... + def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = None, **kw) -> None: ... def __getitem__(self, key: str): ... def __setitem__(self, key: str, value: Any) -> None: ... def delete(self) -> None: ... def config(self, cnf: dict[str, Any] = ..., **kw): ... class Balloon(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = ..., **kw) -> None: ... def unbind_widget(self, widget: tkinter.Widget) -> None: ... class ButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def invoke(self, name: str) -> None: ... class ComboBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add_history(self, str: str) -> None: ... def append_history(self, str: str) -> None: ... def insert(self, index: int, str: str) -> None: ... def pick(self, index: int) -> None: ... class Control(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def decrement(self) -> None: ... def increment(self) -> None: ... def invoke(self) -> None: ... class LabelEntry(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class LabelFrame(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Meter(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class OptionMenu(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -129,7 +129,7 @@ class Select(TixWidget): def invoke(self, name: str) -> None: ... class StdButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def invoke(self, name: str) -> None: ... class DirList(TixWidget): @@ -164,13 +164,13 @@ class FileEntry(TixWidget): def file_dialog(self) -> None: ... class HList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, entry: str, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... - def add_child(self, parent: str | None = ..., cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... + def add_child(self, parent: str | None = None, cnf: dict[str, Any] = ..., **kw) -> tkinter.Widget: ... def anchor_set(self, entry: str) -> None: ... def anchor_clear(self) -> None: ... # FIXME: Overload, certain combos return, others don't - def column_width(self, col: int = ..., width: int | None = ..., chars: int | None = ...) -> int | None: ... + def column_width(self, col: int = 0, width: int | None = None, chars: int | None = None) -> int | None: ... def delete_all(self) -> None: ... def delete_entry(self, entry: str) -> None: ... def delete_offsprings(self, entry: str) -> None: ... @@ -195,7 +195,7 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def indicator_size(self, entry: str) -> int: ... def info_anchor(self) -> str: ... def info_bbox(self, entry: str) -> tuple[int, int, int, int]: ... - def info_children(self, entry: str | None = ...) -> tuple[str, ...]: ... + def info_children(self, entry: str | None = None) -> tuple[str, ...]: ... def info_data(self, entry: str) -> Any: ... def info_dragsite(self) -> str: ... def info_dropsite(self) -> str: ... @@ -216,34 +216,34 @@ class HList(TixWidget, tkinter.XView, tkinter.YView): def see(self, entry: str) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, entry: str) -> bool: ... - def selection_set(self, first: str, last: str | None = ...) -> None: ... + def selection_set(self, first: str, last: str | None = None) -> None: ... def show_entry(self, entry: str) -> None: ... class CheckList(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def getselection(self, mode: str = ...) -> tuple[str, ...]: ... + def getselection(self, mode: str = 'on') -> tuple[str, ...]: ... def getstatus(self, entrypath: str) -> str: ... - def setstatus(self, entrypath: str, mode: str = ...) -> None: ... + def setstatus(self, entrypath: str, mode: str = 'on') -> None: ... class Tree(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def autosetmode(self) -> None: ... def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def setmode(self, entrypath: str, mode: str = ...) -> None: ... + def setmode(self, entrypath: str, mode: str = 'none') -> None: ... class TList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def active_set(self, index: int) -> None: ... def active_clear(self) -> None: ... def anchor_set(self, index: int) -> None: ... def anchor_clear(self) -> None: ... - def delete(self, from_: int, to: int | None = ...) -> None: ... + def delete(self, from_: int, to: int | None = None) -> None: ... def dragsite_set(self, index: int) -> None: ... def dragsite_clear(self) -> None: ... def dropsite_set(self, index: int) -> None: ... @@ -261,7 +261,7 @@ class TList(TixWidget, tkinter.XView, tkinter.YView): def see(self, index: int) -> None: ... def selection_clear(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def selection_includes(self, index: int) -> bool: ... - def selection_set(self, first: int, last: int | None = ...) -> None: ... + def selection_set(self, first: int, last: int | None = None) -> None: ... class PanedWindow(TixWidget): def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -280,7 +280,7 @@ class ListNoteBook(TixWidget): def raise_page(self, name: str) -> None: ... class NoteBook(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... def add(self, name: str, cnf: dict[str, Any] = ..., **kw) -> None: ... def delete(self, name: str) -> None: ... def page(self, name: str) -> tkinter.Widget: ... @@ -289,7 +289,7 @@ class NoteBook(TixWidget): def raised(self) -> bool: ... class InputOnly(TixWidget): - def __init__(self, master: tkinter.Widget | None = ..., cnf: dict[str, Any] = ..., **kw) -> None: ... + def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... class Form: def __setitem__(self, key: str, value: Any) -> None: ... @@ -297,6 +297,6 @@ class Form: def form(self, cnf: dict[str, Any] = ..., **kw) -> None: ... def check(self) -> bool: ... def forget(self) -> None: ... - def grid(self, xsize: int = ..., ysize: int = ...) -> tuple[int, int] | None: ... - def info(self, option: str | None = ...): ... + def grid(self, xsize: int = 0, ysize: int = 0) -> tuple[int, int] | None: ... + def info(self, option: str | None = None): ... def slaves(self) -> list[tkinter.Widget]: ... diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 07584ed9ed87..2172bd2343d6 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -36,7 +36,7 @@ __all__ = [ ] def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ... -def setup_master(master: Incomplete | None = ...): ... +def setup_master(master: Incomplete | None = None): ... _Padding: TypeAlias = Union[ tkinter._ScreenUnits, @@ -52,32 +52,32 @@ _TtkCompound: TypeAlias = Literal["text", "image", tkinter._Compound] class Style: master: Incomplete tk: _tkinter.TkappType - def __init__(self, master: tkinter.Misc | None = ...) -> None: ... - def configure(self, style, query_opt: Incomplete | None = ..., **kw): ... - def map(self, style, query_opt: Incomplete | None = ..., **kw): ... - def lookup(self, style, option, state: Incomplete | None = ..., default: Incomplete | None = ...): ... - def layout(self, style, layoutspec: Incomplete | None = ...): ... + def __init__(self, master: tkinter.Misc | None = None) -> None: ... + def configure(self, style, query_opt: Incomplete | None = None, **kw): ... + def map(self, style, query_opt: Incomplete | None = None, **kw): ... + def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ... + def layout(self, style, layoutspec: Incomplete | None = None): ... def element_create(self, elementname, etype, *args, **kw) -> None: ... def element_names(self): ... def element_options(self, elementname): ... - def theme_create(self, themename, parent: Incomplete | None = ..., settings: Incomplete | None = ...) -> None: ... + def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ... def theme_settings(self, themename, settings) -> None: ... def theme_names(self) -> tuple[str, ...]: ... @overload def theme_use(self, themename: str) -> None: ... @overload - def theme_use(self, themename: None = ...) -> str: ... + def theme_use(self, themename: None = None) -> str: ... class Widget(tkinter.Widget): - def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = ...) -> None: ... + def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ... def identify(self, x: int, y: int) -> str: ... - def instate(self, statespec, callback: Incomplete | None = ..., *args, **kw): ... - def state(self, statespec: Incomplete | None = ...): ... + def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ... + def state(self, statespec: Incomplete | None = None): ... class Button(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -98,7 +98,7 @@ class Button(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -122,7 +122,7 @@ class Button(Widget): class Checkbutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -148,7 +148,7 @@ class Checkbutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -174,8 +174,8 @@ class Checkbutton(Widget): class Entry(Widget, tkinter.Entry): def __init__( self, - master: tkinter.Misc | None = ..., - widget: str | None = ..., + master: tkinter.Misc | None = None, + widget: str | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -199,7 +199,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -224,7 +224,7 @@ class Entry(Widget, tkinter.Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -252,7 +252,7 @@ class Entry(Widget, tkinter.Entry): class Combobox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -279,7 +279,7 @@ class Combobox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -307,7 +307,7 @@ class Combobox(Entry): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., cursor: tkinter._Cursor = ..., @@ -331,13 +331,13 @@ class Combobox(Entry): ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def current(self, newindex: int | None = ...) -> int: ... + def current(self, newindex: int | None = None) -> int: ... def set(self, value: Any) -> None: ... class Frame(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -354,7 +354,7 @@ class Frame(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -373,7 +373,7 @@ class Frame(Widget): class Label(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -401,7 +401,7 @@ class Label(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, anchor: tkinter._Anchor = ..., background: tkinter._Color = ..., @@ -431,7 +431,7 @@ class Label(Widget): class Labelframe(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., # undocumented @@ -452,7 +452,7 @@ class Labelframe(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, border: tkinter._ScreenUnits = ..., borderwidth: tkinter._ScreenUnits = ..., @@ -477,7 +477,7 @@ LabelFrame = Labelframe class Menubutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., compound: _TtkCompound = ..., @@ -498,7 +498,7 @@ class Menubutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, compound: _TtkCompound = ..., cursor: tkinter._Cursor = ..., @@ -521,7 +521,7 @@ class Menubutton(Widget): class Notebook(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -535,7 +535,7 @@ class Notebook(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -564,15 +564,15 @@ class Notebook(Widget): def identify(self, x: int, y: int) -> str: ... def index(self, tab_id): ... def insert(self, pos, child, **kw) -> None: ... - def select(self, tab_id: Incomplete | None = ...): ... - def tab(self, tab_id, option: Incomplete | None = ..., **kw): ... + def select(self, tab_id: Incomplete | None = None): ... + def tab(self, tab_id, option: Incomplete | None = None, **kw): ... def tabs(self): ... def enable_traversal(self) -> None: ... class Panedwindow(Widget, tkinter.PanedWindow): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -588,7 +588,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -602,7 +602,7 @@ class Panedwindow(Widget, tkinter.PanedWindow): @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., height: int = ..., @@ -614,15 +614,15 @@ class Panedwindow(Widget, tkinter.PanedWindow): def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... forget: Incomplete def insert(self, pos, child, **kw) -> None: ... - def pane(self, pane, option: Incomplete | None = ..., **kw): ... - def sashpos(self, index, newpos: Incomplete | None = ...): ... + def pane(self, pane, option: Incomplete | None = None, **kw): ... + def sashpos(self, index, newpos: Incomplete | None = None): ... PanedWindow = Panedwindow class Progressbar(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -640,7 +640,7 @@ class Progressbar(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., length: tkinter._ScreenUnits = ..., @@ -656,14 +656,14 @@ class Progressbar(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def start(self, interval: Literal["idle"] | int | None = ...) -> None: ... - def step(self, amount: float | None = ...) -> None: ... + def start(self, interval: Literal["idle"] | int | None = None) -> None: ... + def step(self, amount: float | None = None) -> None: ... def stop(self) -> None: ... class Radiobutton(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: tkinter._ButtonCommand = ..., @@ -685,7 +685,7 @@ class Radiobutton(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: tkinter._ButtonCommand = ..., compound: _TtkCompound = ..., @@ -711,7 +711,7 @@ class Radiobutton(Widget): class Scale(Widget, tkinter.Scale): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: str | Callable[[str], object] = ..., @@ -730,7 +730,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -750,7 +750,7 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: str | Callable[[str], object] = ..., cursor: tkinter._Cursor = ..., @@ -766,13 +766,13 @@ class Scale(Widget, tkinter.Scale): # type: ignore[misc] ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... @overload def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def get(self, x: int | None = ..., y: int | None = ...) -> float: ... + def get(self, x: int | None = None, y: int | None = None) -> float: ... # type ignore, because identify() methods of Widget and tkinter.Scale are incompatible class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., command: Callable[..., tuple[float, float] | None] | str = ..., @@ -785,7 +785,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -799,7 +799,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] @overload # type: ignore[override] def config( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, command: Callable[..., tuple[float, float] | None] | str = ..., cursor: tkinter._Cursor = ..., @@ -813,7 +813,7 @@ class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] class Separator(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -825,7 +825,7 @@ class Separator(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., orient: Literal["horizontal", "vertical"] = ..., @@ -839,7 +839,7 @@ class Separator(Widget): class Sizegrip(Widget): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., cursor: tkinter._Cursor = ..., @@ -850,7 +850,7 @@ class Sizegrip(Widget): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, cursor: tkinter._Cursor = ..., style: str = ..., @@ -863,7 +863,7 @@ class Sizegrip(Widget): class Spinbox(Entry): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, background: tkinter._Color = ..., # undocumented class_: str = ..., @@ -894,7 +894,7 @@ class Spinbox(Entry): @overload # type: ignore[override] def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, background: tkinter._Color = ..., command: Callable[[], object] | str | list[str] | tuple[str, ...] = ..., @@ -958,7 +958,7 @@ _TreeviewColumnId: TypeAlias = int | str # manual page: "COLUMN IDENTIFIERS" class Treeview(Widget, tkinter.XView, tkinter.YView): def __init__( self, - master: tkinter.Misc | None = ..., + master: tkinter.Misc | None = None, *, class_: str = ..., columns: str | list[str] | tuple[str, ...] = ..., @@ -981,7 +981,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure( self, - cnf: dict[str, Any] | None = ..., + cnf: dict[str, Any] | None = None, *, columns: str | list[str] | tuple[str, ...] = ..., cursor: tkinter._Cursor = ..., @@ -998,8 +998,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] - def get_children(self, item: str | None = ...) -> tuple[str, ...]: ... + def bbox(self, item, column: _TreeviewColumnId | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] + def get_children(self, item: str | None = None) -> tuple[str, ...]: ... def set_children(self, item: str, *newchildren: str) -> None: ... @overload def column(self, column: _TreeviewColumnId, option: Literal["width", "minwidth"]) -> int: ... @@ -1015,7 +1015,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def column( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, width: int = ..., minwidth: int = ..., @@ -1027,7 +1027,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def detach(self, *items: str) -> None: ... def exists(self, item: str) -> bool: ... @overload # type: ignore[override] - def focus(self, item: None = ...) -> str: ... # can return empty string + def focus(self, item: None = None) -> str: ... # can return empty string @overload def focus(self, item: str) -> Literal[""]: ... @overload @@ -1041,12 +1041,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def heading(self, column: _TreeviewColumnId, option: str) -> Any: ... @overload - def heading(self, column: _TreeviewColumnId, option: None = ...) -> _TreeviewHeaderDict: ... # type: ignore[misc] + def heading(self, column: _TreeviewColumnId, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[misc] @overload def heading( self, column: _TreeviewColumnId, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1063,7 +1063,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): self, parent: str, index: int | Literal["end"], - iid: str | None = ..., + iid: str | None = None, *, id: str = ..., # same as iid text: str = ..., @@ -1085,12 +1085,12 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def item(self, item: str, option: str) -> Any: ... @overload - def item(self, item: str, option: None = ...) -> _TreeviewItemDict: ... # type: ignore[misc] + def item(self, item: str, option: None = None) -> _TreeviewItemDict: ... # type: ignore[misc] @overload def item( self, item: str, - option: None = ..., + option: None = None, *, text: str = ..., image: tkinter._ImageSpec = ..., @@ -1114,16 +1114,16 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def selection_remove(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_toggle(self, items: str | list[str] | tuple[str, ...]) -> None: ... @overload - def set(self, item: str, column: None = ..., value: None = ...) -> dict[str, Any]: ... + def set(self, item: str, column: None = None, value: None = None) -> dict[str, Any]: ... @overload - def set(self, item: str, column: _TreeviewColumnId, value: None = ...) -> Any: ... + def set(self, item: str, column: _TreeviewColumnId, value: None = None) -> Any: ... @overload def set(self, item: str, column: _TreeviewColumnId, value: Any) -> Literal[""]: ... # There's no tag_unbind() or 'add' argument for whatever reason. # Also, it's 'callback' instead of 'func' here. @overload def tag_bind( - self, tagname: str, sequence: str | None = ..., callback: Callable[[tkinter.Event[Treeview]], object] | None = ... + self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None ) -> str: ... @overload def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ... @@ -1139,7 +1139,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): def tag_configure( self, tagname: str, - option: None = ..., + option: None = None, *, # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug foreground: tkinter._Color = ..., @@ -1148,7 +1148,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): image: tkinter._ImageSpec = ..., ) -> _TreeviewTagDict | Any: ... # can be None but annoying to check @overload - def tag_has(self, tagname: str, item: None = ...) -> tuple[str, ...]: ... + def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ... @overload def tag_has(self, tagname: str, item: str) -> bool: ... @@ -1158,10 +1158,10 @@ class LabeledScale(Frame): # TODO: don't any-type **kw. That goes to Frame.__init__. def __init__( self, - master: tkinter.Misc | None = ..., - variable: tkinter.IntVar | tkinter.DoubleVar | None = ..., - from_: float = ..., - to: float = ..., + master: tkinter.Misc | None = None, + variable: tkinter.IntVar | tkinter.DoubleVar | None = None, + from_: float = 0, + to: float = 10, *, compound: Literal["top", "bottom"] = ..., **kw, @@ -1174,7 +1174,7 @@ class OptionMenu(Menubutton): self, master, variable, - default: str | None = ..., + default: str | None = None, *values: str, # rest of these are keyword-only because *args syntax used above style: str = ..., @@ -1183,4 +1183,4 @@ class OptionMenu(Menubutton): ) -> None: ... # configure, config, cget, destroy are inherited from Menubutton # destroy and __setitem__ are overridden, signature does not change - def set_menu(self, default: Incomplete | None = ..., *values) -> None: ... + def set_menu(self, default: Incomplete | None = None, *values) -> None: ... diff --git a/stdlib/traceback.pyi b/stdlib/traceback.pyi index d289cf690992..c2a4f377298e 100644 --- a/stdlib/traceback.pyi +++ b/stdlib/traceback.pyi @@ -37,24 +37,24 @@ if sys.version_info >= (3, 10): __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... @overload def print_exception( - __exc: BaseException, *, limit: int | None = ..., file: SupportsWrite[str] | None = ..., chain: bool = ... + __exc: BaseException, *, limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True ) -> None: ... @overload def format_exception( __exc: type[BaseException] | None, value: BaseException | None = ..., tb: TracebackType | None = ..., - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... @overload - def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ... + def format_exception(__exc: BaseException, *, limit: int | None = None, chain: bool = True) -> list[str]: ... else: def print_exception( @@ -146,11 +146,11 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - compact: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + compact: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( @@ -183,7 +183,7 @@ class TracebackException: if sys.version_info >= (3, 11): def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ... else: - def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... + def format(self, *, chain: bool = True) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... @@ -215,9 +215,9 @@ class FrameSummary(Iterable[Any]): lineno: int | None, name: str, *, - lookup_line: bool = ..., - locals: Mapping[str, str] | None = ..., - line: str | None = ..., + lookup_line: bool = True, + locals: Mapping[str, str] | None = None, + line: str | None = None, ) -> None: ... filename: str lineno: int | None diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 13197c336e5e..f7cfc9592245 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -161,11 +161,11 @@ class ScrolledCanvas(Canvas, Frame): # type: ignore[misc] hscroll: Scrollbar vscroll: Scrollbar def __init__( - self, master: Misc | None, width: int = ..., height: int = ..., canvwidth: int = ..., canvheight: int = ... + self, master: Misc | None, width: int = 500, height: int = 350, canvwidth: int = 600, canvheight: int = 500 ) -> None: ... canvwidth: int canvheight: int - def reset(self, canvwidth: int | None = ..., canvheight: int | None = ..., bg: str | None = ...) -> None: ... + def reset(self, canvwidth: int | None = None, canvheight: int | None = None, bg: str | None = None) -> None: ... class TurtleScreenBase: cv: Canvas @@ -177,27 +177,27 @@ class TurtleScreenBase: def mainloop(self) -> None: ... def textinput(self, title: str, prompt: str) -> str | None: ... def numinput( - self, title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + self, title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... class Terminator(Exception): ... class TurtleGraphicsError(Exception): ... class Shape: - def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = ...) -> None: ... - def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = ...) -> None: ... + def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = None) -> None: ... + def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ... class TurtleScreen(TurtleScreenBase): - def __init__(self, cv: Canvas, mode: str = ..., colormode: float = ..., delay: int = ...) -> None: ... + def __init__(self, cv: Canvas, mode: str = 'standard', colormode: float = 1.0, delay: int = 10) -> None: ... def clear(self) -> None: ... @overload - def mode(self, mode: None = ...) -> str: ... + def mode(self, mode: None = None) -> str: ... @overload def mode(self, mode: str) -> None: ... def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... - def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... + def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload - def colormode(self, cmode: None = ...) -> float: ... + def colormode(self, cmode: None = None) -> float: ... @overload def colormode(self, cmode: float) -> None: ... def reset(self) -> None: ... @@ -209,11 +209,11 @@ class TurtleScreen(TurtleScreenBase): @overload def bgcolor(self, r: float, g: float, b: float) -> None: ... @overload - def tracer(self, n: None = ...) -> int: ... + def tracer(self, n: None = None) -> int: ... @overload - def tracer(self, n: int, delay: int | None = ...) -> None: ... + def tracer(self, n: int, delay: int | None = None) -> None: ... @overload - def delay(self, delay: None = ...) -> int: ... + def delay(self, delay: None = None) -> int: ... @overload def delay(self, delay: int) -> None: ... def update(self) -> None: ... @@ -221,24 +221,24 @@ class TurtleScreen(TurtleScreenBase): def window_height(self) -> int: ... def getcanvas(self) -> Canvas: ... def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(self, fun: Callable[[], object], key: str) -> None: ... - def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... - def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ... + def listen(self, xdummy: float | None = None, ydummy: float | None = None) -> None: ... + def ontimer(self, fun: Callable[[], object], t: int = 0) -> None: ... @overload - def bgpic(self, picname: None = ...) -> str: ... + def bgpic(self, picname: None = None) -> str: ... @overload def bgpic(self, picname: str) -> None: ... @overload - def screensize(self, canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... + def screensize(self, canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... # Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well @overload - def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... + def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape - def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ... + def onkeypress(self, fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey class TNavigator: @@ -246,9 +246,9 @@ class TNavigator: DEFAULT_MODE: str DEFAULT_ANGLEOFFSET: int DEFAULT_ANGLEORIENT: int - def __init__(self, mode: str = ...) -> None: ... + def __init__(self, mode: str = 'standard') -> None: ... def reset(self) -> None: ... - def degrees(self, fullcircle: float = ...) -> None: ... + def degrees(self, fullcircle: float = 360.0) -> None: ... def radians(self) -> None: ... def forward(self, distance: float) -> None: ... def back(self, distance: float) -> None: ... @@ -258,23 +258,23 @@ class TNavigator: def xcor(self) -> float: ... def ycor(self) -> float: ... @overload - def goto(self, x: tuple[float, float], y: None = ...) -> None: ... + def goto(self, x: tuple[float, float], y: None = None) -> None: ... @overload def goto(self, x: float, y: float) -> None: ... def home(self) -> None: ... def setx(self, x: float) -> None: ... def sety(self, y: float) -> None: ... @overload - def distance(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def distance(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(self, x: float, y: float) -> float: ... @overload - def towards(self, x: TNavigator | tuple[float, float], y: None = ...) -> float: ... + def towards(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(self, x: float, y: float) -> float: ... def heading(self) -> float: ... def setheading(self, to_angle: float) -> None: ... - def circle(self, radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... + def circle(self, radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back backward = back @@ -286,20 +286,20 @@ class TNavigator: seth = setheading class TPen: - def __init__(self, resizemode: str = ...) -> None: ... + def __init__(self, resizemode: str = 'noresize') -> None: ... @overload - def resizemode(self, rmode: None = ...) -> str: ... + def resizemode(self, rmode: None = None) -> str: ... @overload def resizemode(self, rmode: str) -> None: ... @overload - def pensize(self, width: None = ...) -> int: ... + def pensize(self, width: None = None) -> int: ... @overload def pensize(self, width: int) -> None: ... def penup(self) -> None: ... def pendown(self) -> None: ... def isdown(self) -> bool: ... @overload - def speed(self, speed: None = ...) -> int: ... + def speed(self, speed: None = None) -> int: ... @overload def speed(self, speed: _Speed) -> None: ... @overload @@ -331,7 +331,7 @@ class TPen: @overload def pen( self, - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -356,7 +356,7 @@ class RawTurtle(TPen, TNavigator): screen: TurtleScreen screens: ClassVar[list[TurtleScreen]] def __init__( - self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... + self, canvas: Canvas | TurtleScreen | None = None, shape: str = 'classic', undobuffersize: int = 1000, visible: bool = True ) -> None: ... def reset(self) -> None: ... def setundobuffer(self, size: int | None) -> None: ... @@ -364,7 +364,7 @@ class RawTurtle(TPen, TNavigator): def clear(self) -> None: ... def clone(self: Self) -> Self: ... @overload - def shape(self, name: None = ...) -> str: ... + def shape(self, name: None = None) -> str: ... @overload def shape(self, name: str) -> None: ... # Unsafely overlaps when no arguments are provided @@ -372,10 +372,10 @@ class RawTurtle(TPen, TNavigator): def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[misc] @overload def shapesize( - self, stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ... + self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None ) -> None: ... @overload - def shearfactor(self, shear: None = ...) -> float: ... + def shearfactor(self, shear: None = None) -> float: ... @overload def shearfactor(self, shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @@ -383,12 +383,12 @@ class RawTurtle(TPen, TNavigator): def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - self, t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly(self) -> _PolygonCoords | None: ... def settiltangle(self, angle: float) -> None: ... @overload - def tiltangle(self, angle: None = ...) -> float: ... + def tiltangle(self, angle: None = None) -> float: ... @overload def tiltangle(self, angle: float) -> None: ... def tilt(self, angle: float) -> None: ... @@ -397,21 +397,21 @@ class RawTurtle(TPen, TNavigator): # we return Any. def stamp(self) -> Any: ... def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ... - def clearstamps(self, n: int | None = ...) -> None: ... + def clearstamps(self, n: int | None = None) -> None: ... def filling(self) -> bool: ... def begin_fill(self) -> None: ... def end_fill(self) -> None: ... - def dot(self, size: int | None = ..., *color: _Color) -> None: ... - def write(self, arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... + def dot(self, size: int | None = None, *color: _Color) -> None: ... + def write(self, arg: object, move: bool = False, align: str = 'left', font: tuple[str, int, str] = ...) -> None: ... def begin_poly(self) -> None: ... def end_poly(self) -> None: ... def get_poly(self) -> _PolygonCoords | None: ... def getscreen(self) -> TurtleScreen: ... def getturtle(self: Self) -> Self: ... getpen = getturtle - def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... - def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ... + def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def onrelease(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... + def ondrag(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... def undo(self) -> None: ... turtlesize = shapesize @@ -420,22 +420,22 @@ class _Screen(TurtleScreen): # Note int and float are interpreted differently, hence the Union instead of just float def setup( self, - width: int | float = ..., # noqa: Y041 - height: int | float = ..., # noqa: Y041 - startx: int | None = ..., - starty: int | None = ..., + width: int | float = 0.5, # noqa: Y041 + height: int | float = 0.75, # noqa: Y041 + startx: int | None = None, + starty: int | None = None, ) -> None: ... def title(self, titlestring: str) -> None: ... def bye(self) -> None: ... def exitonclick(self) -> None: ... class Turtle(RawTurtle): - def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... + def __init__(self, shape: str = 'classic', undobuffersize: int = 1000, visible: bool = True) -> None: ... RawPen = RawTurtle Pen = Turtle -def write_docstringdict(filename: str = ...) -> None: ... +def write_docstringdict(filename: str = 'turtle_docstringdict') -> None: ... # Note: it's somewhat unfortunate that we have to copy the function signatures. # It would be nice if we could partially reduce the redundancy by doing something @@ -453,20 +453,20 @@ def write_docstringdict(filename: str = ...) -> None: ... def mainloop() -> None: ... def textinput(title: str, prompt: str) -> str | None: ... def numinput( - title: str, prompt: str, default: float | None = ..., minval: float | None = ..., maxval: float | None = ... + title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None ) -> float | None: ... # Functions copied from TurtleScreen: def clear() -> None: ... @overload -def mode(mode: None = ...) -> str: ... +def mode(mode: None = None) -> str: ... @overload def mode(mode: str) -> None: ... def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... -def register_shape(name: str, shape: _PolygonCoords | Shape | None = ...) -> None: ... +def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... @overload -def colormode(cmode: None = ...) -> float: ... +def colormode(cmode: None = None) -> float: ... @overload def colormode(cmode: float) -> None: ... def reset() -> None: ... @@ -478,11 +478,11 @@ def bgcolor(color: _Color) -> None: ... @overload def bgcolor(r: float, g: float, b: float) -> None: ... @overload -def tracer(n: None = ...) -> int: ... +def tracer(n: None = None) -> int: ... @overload -def tracer(n: int, delay: int | None = ...) -> None: ... +def tracer(n: int, delay: int | None = None) -> None: ... @overload -def delay(delay: None = ...) -> int: ... +def delay(delay: None = None) -> int: ... @overload def delay(delay: int) -> None: ... def update() -> None: ... @@ -490,31 +490,31 @@ def window_width() -> int: ... def window_height() -> int: ... def getcanvas() -> Canvas: ... def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onclick(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def onkey(fun: Callable[[], object], key: str) -> None: ... -def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ... -def ontimer(fun: Callable[[], object], t: int = ...) -> None: ... +def listen(xdummy: float | None = None, ydummy: float | None = None) -> None: ... +def ontimer(fun: Callable[[], object], t: int = 0) -> None: ... @overload -def bgpic(picname: None = ...) -> str: ... +def bgpic(picname: None = None) -> str: ... @overload def bgpic(picname: str) -> None: ... @overload -def screensize(canvwidth: None = ..., canvheight: None = ..., bg: None = ...) -> tuple[int, int]: ... +def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... @overload -def screensize(canvwidth: int, canvheight: int, bg: _Color | None = ...) -> None: ... +def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... onscreenclick = onclick resetscreen = reset clearscreen = clear addshape = register_shape -def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ... +def onkeypress(fun: Callable[[], object], key: str | None = None) -> None: ... onkeyrelease = onkey # Functions copied from _Screen: -def setup(width: float = ..., height: float = ..., startx: int | None = ..., starty: int | None = ...) -> None: ... +def setup(width: float = 0.5, height: float = 0.75, startx: int | None = None, starty: int | None = None) -> None: ... def title(titlestring: str) -> None: ... def bye() -> None: ... def exitonclick() -> None: ... @@ -522,7 +522,7 @@ def Screen() -> _Screen: ... # Functions copied from TNavigator: -def degrees(fullcircle: float = ...) -> None: ... +def degrees(fullcircle: float = 360.0) -> None: ... def radians() -> None: ... def forward(distance: float) -> None: ... def back(distance: float) -> None: ... @@ -532,23 +532,23 @@ def pos() -> Vec2D: ... def xcor() -> float: ... def ycor() -> float: ... @overload -def goto(x: tuple[float, float], y: None = ...) -> None: ... +def goto(x: tuple[float, float], y: None = None) -> None: ... @overload def goto(x: float, y: float) -> None: ... def home() -> None: ... def setx(x: float) -> None: ... def sety(y: float) -> None: ... @overload -def distance(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def distance(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def distance(x: float, y: float) -> float: ... @overload -def towards(x: TNavigator | tuple[float, float], y: None = ...) -> float: ... +def towards(x: TNavigator | tuple[float, float], y: None = None) -> float: ... @overload def towards(x: float, y: float) -> float: ... def heading() -> float: ... def setheading(to_angle: float) -> None: ... -def circle(radius: float, extent: float | None = ..., steps: int | None = ...) -> None: ... +def circle(radius: float, extent: float | None = None, steps: int | None = None) -> None: ... fd = forward bk = back @@ -562,18 +562,18 @@ seth = setheading # Functions copied from TPen: @overload -def resizemode(rmode: None = ...) -> str: ... +def resizemode(rmode: None = None) -> str: ... @overload def resizemode(rmode: str) -> None: ... @overload -def pensize(width: None = ...) -> int: ... +def pensize(width: None = None) -> int: ... @overload def pensize(width: int) -> None: ... def penup() -> None: ... def pendown() -> None: ... def isdown() -> bool: ... @overload -def speed(speed: None = ...) -> int: ... +def speed(speed: None = None) -> int: ... @overload def speed(speed: _Speed) -> None: ... @overload @@ -605,7 +605,7 @@ def isvisible() -> bool: ... def pen() -> _PenState: ... # type: ignore[misc] @overload def pen( - pen: _PenState | None = ..., + pen: _PenState | None = None, *, shown: bool = ..., pendown: bool = ..., @@ -632,7 +632,7 @@ ht = hideturtle def setundobuffer(size: int | None) -> None: ... def undobufferentries() -> int: ... @overload -def shape(name: None = ...) -> str: ... +def shape(name: None = None) -> str: ... @overload def shape(name: str) -> None: ... @@ -640,9 +640,9 @@ def shape(name: str) -> None: ... @overload def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc] @overload -def shapesize(stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...) -> None: ... +def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ... @overload -def shearfactor(shear: None = ...) -> float: ... +def shearfactor(shear: None = None) -> float: ... @overload def shearfactor(shear: float) -> None: ... @@ -651,12 +651,12 @@ def shearfactor(shear: float) -> None: ... def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[misc] @overload def shapetransform( - t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ... + t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None ) -> None: ... def get_shapepoly() -> _PolygonCoords | None: ... def settiltangle(angle: float) -> None: ... @overload -def tiltangle(angle: None = ...) -> float: ... +def tiltangle(angle: None = None) -> float: ... @overload def tiltangle(angle: float) -> None: ... def tilt(angle: float) -> None: ... @@ -666,12 +666,12 @@ def tilt(angle: float) -> None: ... # we return Any. def stamp() -> Any: ... def clearstamp(stampid: int | tuple[int, ...]) -> None: ... -def clearstamps(n: int | None = ...) -> None: ... +def clearstamps(n: int | None = None) -> None: ... def filling() -> bool: ... def begin_fill() -> None: ... def end_fill() -> None: ... -def dot(size: int | None = ..., *color: _Color) -> None: ... -def write(arg: object, move: bool = ..., align: str = ..., font: tuple[str, int, str] = ...) -> None: ... +def dot(size: int | None = None, *color: _Color) -> None: ... +def write(arg: object, move: bool = False, align: str = 'left', font: tuple[str, int, str] = ...) -> None: ... def begin_poly() -> None: ... def end_poly() -> None: ... def get_poly() -> _PolygonCoords | None: ... @@ -680,8 +680,8 @@ def getturtle() -> Turtle: ... getpen = getturtle -def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... -def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ... +def onrelease(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... +def ondrag(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... def undo() -> None: ... turtlesize = shapesize diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 5ce103b24269..2443e8006058 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -264,22 +264,22 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_linetable: bytes = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, + co_code: bytes = None, + co_consts: tuple[object, ...] = None, + co_names: tuple[str, ...] = None, + co_varnames: tuple[str, ...] = None, + co_freevars: tuple[str, ...] = None, + co_cellvars: tuple[str, ...] = None, + co_filename: str = None, + co_name: str = None, + co_linetable: bytes = None, ) -> CodeType: ... elif sys.version_info >= (3, 8): def replace( diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 8d3531941d56..9670c9d6a74a 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -467,7 +467,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]): @abstractmethod def __getitem__(self, index: slice) -> Sequence[_T_co]: ... # Mixin methods - def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ... + def index(self, value: Any, start: int = 0, stop: int = None) -> int: ... def count(self, value: Any) -> int: ... def __contains__(self, value: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index a635785b3009..73a41f16600d 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -224,9 +224,9 @@ else: def dataclass_transform( *, - eq_default: bool = ..., - order_default: bool = ..., - kw_only_default: bool = ..., + eq_default: bool = True, + order_default: bool = False, + kw_only_default: bool = False, field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = ..., **kwargs: object, ) -> IdentityFunction: ... @@ -268,11 +268,11 @@ class TypeVar: self, name: str, *constraints: Any, - bound: Any | None = ..., - covariant: bool = ..., - contravariant: bool = ..., - default: Any | None = ..., - infer_variance: bool = ..., + bound: Any | None = None, + covariant: bool = False, + contravariant: bool = False, + default: Any | None = None, + infer_variance: bool = False, ) -> None: ... if sys.version_info >= (3, 10): def __or__(self, right: Any) -> _SpecialForm: ... @@ -294,7 +294,7 @@ class ParamSpec: bound: None | type[Any] | str = None, contravariant: bool = False, covariant: bool = False, - default: type[Any] | str | None = ..., + default: type[Any] | str | None = None, ) -> None: ... @property def args(self) -> ParamSpecArgs: ... @@ -305,7 +305,7 @@ class ParamSpec: class TypeVarTuple: __name__: str __default__: Any | None - def __init__(self, name: str, *, default: Any | None = ...) -> None: ... + def __init__(self, name: str, *, default: Any | None = None) -> None: ... def __iter__(self) -> Any: ... # Unpack[Self] def override(__arg: _F) -> _F: ... diff --git a/stdlib/unittest/case.pyi b/stdlib/unittest/case.pyi index 84bda6873710..5b1bd9288659 100644 --- a/stdlib/unittest/case.pyi +++ b/stdlib/unittest/case.pyi @@ -123,21 +123,21 @@ class TestCase: def assertIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = None) -> None: ... def assertNotIsInstance(self, obj: object, cls: _IsInstanceClassInfo, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = ...) -> None: ... + def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = ...) -> None: ... + def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = None) -> None: ... @overload - def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = ...) -> None: ... + def assertLessEqual(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... @overload - def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = ...) -> None: ... + def assertLessEqual(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... # `assertRaises`, `assertRaisesRegex`, and `assertRaisesRegexp` # are not using `ParamSpec` intentionally, # because they might be used with explicitly wrong arg types to raise some error in tests. @@ -203,49 +203,49 @@ class TestCase: def assertAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... @overload def assertNotAlmostEqual( - self, first: _S, second: _S, places: None = ..., msg: Any = ..., *, delta: _SupportsAbsAndDunderGE + self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE ) -> None: ... @overload def assertNotAlmostEqual( self, first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], second: _T, - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... @overload def assertNotAlmostEqual( self, first: _T, second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = ..., - msg: Any = ..., - delta: None = ..., + places: int | None = None, + msg: Any = None, + delta: None = None, ) -> None: ... def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... diff --git a/stdlib/unittest/signals.pyi b/stdlib/unittest/signals.pyi index 89e108d926a6..a60133ada9d9 100644 --- a/stdlib/unittest/signals.pyi +++ b/stdlib/unittest/signals.pyi @@ -10,6 +10,6 @@ def installHandler() -> None: ... def registerResult(result: unittest.result.TestResult) -> None: ... def removeResult(result: unittest.result.TestResult) -> bool: ... @overload -def removeHandler(method: None = ...) -> None: ... +def removeHandler(method: None = None) -> None: ... @overload def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 4d5c69937808..f1ae62237d71 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -132,14 +132,14 @@ def parse_qsl( separator: str = "&", ) -> list[tuple[AnyStr, AnyStr]]: ... @overload -def quote(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote(string: str, safe: str | Iterable[int] = '/', encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ... +def quote(string: bytes | bytearray, safe: str | Iterable[int] = '/') -> str: ... def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... @overload -def quote_plus(string: str, safe: str | Iterable[int] = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ... +def quote_plus(string: str, safe: str | Iterable[int] = '', encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = ...) -> str: ... +def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = '') -> str: ... if sys.version_info >= (3, 9): def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... @@ -159,20 +159,20 @@ _Q = TypeVar("_Q", bound=str | Iterable[int]) def urlencode( query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]], doseq: bool = False, - safe: _Q = ..., + safe: _Q = '', encoding: str | None = None, errors: str | None = None, quote_via: Callable[[AnyStr, _Q, str, str], str] = ..., ) -> str: ... def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ... @overload -def urlparse(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> ParseResult: ... +def urlparse(url: str, scheme: str | None = '', allow_fragments: bool = True) -> ParseResult: ... @overload def urlparse( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = ... + url: bytes | bytearray | None, scheme: bytes | bytearray | None = '', allow_fragments: bool = True ) -> ParseResultBytes: ... @overload -def urlsplit(url: str, scheme: str | None = ..., allow_fragments: bool = ...) -> SplitResult: ... +def urlsplit(url: str, scheme: str | None = '', allow_fragments: bool = True) -> SplitResult: ... if sys.version_info >= (3, 11): @overload @@ -181,7 +181,7 @@ if sys.version_info >= (3, 11): else: @overload def urlsplit( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = ... + url: bytes | bytearray | None, scheme: bytes | bytearray | None = '', allow_fragments: bool = True ) -> SplitResultBytes: ... @overload diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index a1717bc252a4..a9ecff675009 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -96,14 +96,14 @@ class catch_warnings(Generic[_W]): ) -> None: ... else: @overload - def __init__(self: catch_warnings[None], *, record: Literal[False] = ..., module: ModuleType | None = ...) -> None: ... + def __init__(self: catch_warnings[None], *, record: Literal[False] = False, module: ModuleType | None = None) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = None ) -> None: ... @overload def __init__( - self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = ... + self: catch_warnings[list[WarningMessage] | None], *, record: bool, module: ModuleType | None = None ) -> None: ... def __enter__(self) -> _W: ... diff --git a/stdlib/wave.pyi b/stdlib/wave.pyi index 69d583a85ad8..3817ae09307f 100644 --- a/stdlib/wave.pyi +++ b/stdlib/wave.pyi @@ -72,7 +72,7 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Wave_read: ... @overload def open(f: _File, mode: Literal["w", "wb"]) -> Wave_write: ... @overload -def open(f: _File, mode: str | None = ...) -> Any: ... +def open(f: _File, mode: str | None = None) -> Any: ... if sys.version_info < (3, 9): openfp = open diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 583dfdb69d6b..a1a079d1a159 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -70,7 +70,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload @@ -92,7 +92,7 @@ class KeyedRef(ref[_T], Generic[_KT, _T]): class WeakKeyDictionary(MutableMapping[_KT, _VT]): @overload - def __init__(self, dict: None = ...) -> None: ... + def __init__(self, dict: None = None) -> None: ... @overload def __init__(self, dict: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]]) -> None: ... def __len__(self) -> int: ... @@ -109,7 +109,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def values(self) -> Iterator[_VT]: ... # type: ignore[override] def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def keyrefs(self) -> list[ref[_KT]]: ... - def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload diff --git a/stdlib/webbrowser.pyi b/stdlib/webbrowser.pyi index 9f4eea3bd651..d15ae49fd1e8 100644 --- a/stdlib/webbrowser.pyi +++ b/stdlib/webbrowser.pyi @@ -58,7 +58,7 @@ class Grail(BaseBrowser): if sys.platform == "win32": class WindowsDefault(BaseBrowser): - def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ... + def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... if sys.platform == "darwin": class MacOSX(BaseBrowser): diff --git a/stdlib/winreg.pyi b/stdlib/winreg.pyi index 2cc42318f1a4..6377492babc7 100644 --- a/stdlib/winreg.pyi +++ b/stdlib/winreg.pyi @@ -9,17 +9,17 @@ if sys.platform == "win32": def CloseKey(__hkey: _KeyType) -> None: ... def ConnectRegistry(__computer_name: str | None, __key: _KeyType) -> HKEYType: ... def CreateKey(__key: _KeyType, __sub_key: str | None) -> HKEYType: ... - def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = ..., access: int = ...) -> HKEYType: ... + def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ... def DeleteKey(__key: _KeyType, __sub_key: str) -> None: ... - def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ... + def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ... def DeleteValue(__key: _KeyType, __value: str) -> None: ... def EnumKey(__key: _KeyType, __index: int) -> str: ... def EnumValue(__key: _KeyType, __index: int) -> tuple[str, Any, int]: ... def ExpandEnvironmentStrings(__str: str) -> str: ... def FlushKey(__key: _KeyType) -> None: ... def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ... - def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... - def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ... + def OpenKey(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... + def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... def QueryInfoKey(__key: _KeyType) -> tuple[int, int, int]: ... def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ... def QueryValueEx(__key: _KeyType, __name: str) -> tuple[Any, int]: ... diff --git a/stdlib/winsound.pyi b/stdlib/winsound.pyi index fd5a552cf9c1..9b2b57a38986 100644 --- a/stdlib/winsound.pyi +++ b/stdlib/winsound.pyi @@ -25,4 +25,4 @@ if sys.platform == "win32": def PlaySound(sound: ReadableBuffer | None, flags: Literal[4]) -> None: ... @overload def PlaySound(sound: str | ReadableBuffer | None, flags: int) -> None: ... - def MessageBeep(type: int = ...) -> None: ... + def MessageBeep(type: int = 0) -> None: ... diff --git a/stdlib/wsgiref/headers.pyi b/stdlib/wsgiref/headers.pyi index 664ed947fc72..2654d79bf4e5 100644 --- a/stdlib/wsgiref/headers.pyi +++ b/stdlib/wsgiref/headers.pyi @@ -17,7 +17,7 @@ class Headers: @overload def get(self, name: str, default: str) -> str: ... @overload - def get(self, name: str, default: str | None = ...) -> str | None: ... + def get(self, name: str, default: str | None = None) -> str | None: ... def keys(self) -> list[str]: ... def values(self) -> list[str]: ... def items(self) -> _HeaderList: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 38a4ea07d12b..9c1386313c24 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -54,10 +54,10 @@ def iselement(element: object) -> TypeGuard[Element]: ... if sys.version_info >= (3, 8): @overload def canonicalize( - xml_data: str | ReadableBuffer | None = ..., + xml_data: str | ReadableBuffer | None = None, *, - out: None = ..., - from_file: _FileRead | None = ..., + out: None = None, + from_file: _FileRead | None = None, with_comments: bool = ..., strip_text: bool = ..., rewrite_prefixes: bool = ..., @@ -68,10 +68,10 @@ if sys.version_info >= (3, 8): ) -> str: ... @overload def canonicalize( - xml_data: str | ReadableBuffer | None = ..., + xml_data: str | ReadableBuffer | None = None, *, out: SupportsWrite[str], - from_file: _FileRead | None = ..., + from_file: _FileRead | None = None, with_comments: bool = ..., strip_text: bool = ..., rewrite_prefixes: bool = ..., @@ -93,11 +93,11 @@ class Element: def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... @overload - def get(self, key: str, default: None = ...) -> str | None: ... + def get(self, key: str, default: None = None) -> str | None: ... @overload def get(self, key: str, default: _T) -> str | _T: ... def insert(self, __index: int, __subelement: Element) -> None: ... @@ -153,9 +153,9 @@ class ElementTree: def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... @overload - def findtext(self, path: str, default: None = ..., namespaces: dict[str, str] | None = ...) -> str | None: ... + def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = ...) -> _T | str: ... + def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... def write( @@ -176,62 +176,62 @@ if sys.version_info >= (3, 8): @overload def tostring( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> bytes: ... @overload def tostring( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> str: ... @overload def tostring( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> Any: ... @overload def tostringlist( element: Element, - encoding: None = ..., - method: str | None = ..., + encoding: None = None, + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[bytes]: ... @overload def tostringlist( element: Element, encoding: Literal["unicode"], - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[str]: ... @overload def tostringlist( element: Element, encoding: str, - method: str | None = ..., + method: str | None = None, *, - xml_declaration: bool | None = ..., - default_namespace: str | None = ..., - short_empty_elements: bool = ..., + xml_declaration: bool | None = None, + default_namespace: str | None = None, + short_empty_elements: bool = True, ) -> list[Any]: ... else: diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 25c5b6d3f8ad..bd4cf62a0d40 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -212,7 +212,7 @@ def loads( data: str, use_datetime: bool = False, use_builtin_types: bool = False ) -> tuple[tuple[_Marshallable, ...], str | None]: ... def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented -def gzip_decode(data: ReadableBuffer, max_decode: int = ...) -> bytes: ... # undocumented +def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented class GzipDecodedResponse(gzip.GzipFile): # undocumented diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index c4c33d5d2876..e9267dbc89cc 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -70,7 +70,7 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ClosableZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., + pwd: bytes | None = None, *, close_fileobj: Literal[True], ) -> None: ... @@ -80,8 +80,8 @@ class ZipExtFile(io.BufferedIOBase): fileobj: _ZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, - pwd: bytes | None = ..., - close_fileobj: Literal[False] = ..., + pwd: bytes | None = None, + close_fileobj: Literal[False] = False, ) -> None: ... def read(self, n: int | None = -1) -> bytes: ... def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] @@ -133,12 +133,12 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = 'r', + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, ) -> None: ... else: def __init__( diff --git a/stdlib/zlib.pyi b/stdlib/zlib.pyi index 3f77dd958021..4f719b3a54fc 100644 --- a/stdlib/zlib.pyi +++ b/stdlib/zlib.pyi @@ -46,7 +46,7 @@ if sys.version_info >= (3, 11): def compress(__data: ReadableBuffer, level: int = -1, wbits: int = 15) -> bytes: ... else: - def compress(__data: ReadableBuffer, level: int = ...) -> bytes: ... + def compress(__data: ReadableBuffer, level: int = -1) -> bytes: ... def compressobj( level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None From 92f0aa9388973b7afd831250e679d97b2dff57e6 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Jan 2023 23:53:56 +0000 Subject: [PATCH 02/13] py39 branches --- stdlib/_bisect.pyi | 8 +- stdlib/_bootlocale.pyi | 2 +- stdlib/asyncio/locks.pyi | 8 +- stdlib/asyncio/proactor_events.pyi | 6 +- stdlib/asyncio/queues.pyi | 2 +- stdlib/asyncio/streams.pyi | 16 +- stdlib/asyncio/subprocess.pyi | 20 +- stdlib/asyncio/tasks.pyi | 44 +-- stdlib/compileall.pyi | 48 ++-- stdlib/contextlib.pyi | 2 +- stdlib/dataclasses.pyi | 46 +-- stdlib/distutils/command/bdist_msi.pyi | 6 +- stdlib/distutils/command/bdist_wininst.pyi | 2 +- stdlib/fileinput.pyi | 52 ++-- stdlib/formatter.pyi | 18 +- stdlib/glob.pyi | 4 +- stdlib/inspect.pyi | 4 +- stdlib/logging/__init__.pyi | 2 +- stdlib/logging/config.pyi | 4 +- stdlib/pathlib.pyi | 2 +- stdlib/pprint.pyi | 36 +-- stdlib/py_compile.pyi | 2 +- stdlib/pyclbr.pyi | 4 +- stdlib/subprocess.pyi | 318 ++++++++++----------- stdlib/tempfile.pyi | 4 +- stdlib/traceback.pyi | 18 +- stdlib/types.pyi | 32 +-- stdlib/unittest/mock.pyi | 2 +- 28 files changed, 356 insertions(+), 356 deletions(-) diff --git a/stdlib/_bisect.pyi b/stdlib/_bisect.pyi index cb036d904474..1b41ddb1a793 100644 --- a/stdlib/_bisect.pyi +++ b/stdlib/_bisect.pyi @@ -61,14 +61,14 @@ if sys.version_info >= (3, 10): else: def bisect_left( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def bisect_right( - a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: Sequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> int: ... def insort_left( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... def insort_right( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = ..., hi: int | None = ... + a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None ) -> None: ... diff --git a/stdlib/_bootlocale.pyi b/stdlib/_bootlocale.pyi index ee2d89347a9f..233d4934f3c6 100644 --- a/stdlib/_bootlocale.pyi +++ b/stdlib/_bootlocale.pyi @@ -1 +1 @@ -def getpreferredencoding(do_setlocale: bool = ...) -> str: ... +def getpreferredencoding(do_setlocale: bool = True) -> str: ... diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index 3e348e8c35e0..357dfbc2bd1c 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -48,7 +48,7 @@ class Lock(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -58,7 +58,7 @@ class Event: if sys.version_info >= (3, 11): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... @@ -69,7 +69,7 @@ class Condition(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, lock: Lock | None = None) -> None: ... else: - def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -85,7 +85,7 @@ class Semaphore(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, value: int = 1) -> None: ... else: - def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = None) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... diff --git a/stdlib/asyncio/proactor_events.pyi b/stdlib/asyncio/proactor_events.pyi index 7fa1af0ca457..9d582684a261 100644 --- a/stdlib/asyncio/proactor_events.pyi +++ b/stdlib/asyncio/proactor_events.pyi @@ -47,9 +47,9 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTran loop: events.AbstractEventLoop, sock: socket, protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = ..., - extra: Mapping[Any, Any] | None = ..., - server: events.AbstractServer | None = ..., + waiter: futures.Future[Any] | None = None, + extra: Mapping[Any, Any] | None = None, + server: events.AbstractServer | None = None, ) -> None: ... class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): ... diff --git a/stdlib/asyncio/queues.pyi b/stdlib/asyncio/queues.pyi index 76273be7588c..cdc6fa5aeb90 100644 --- a/stdlib/asyncio/queues.pyi +++ b/stdlib/asyncio/queues.pyi @@ -16,7 +16,7 @@ class Queue(Generic[_T]): if sys.version_info >= (3, 11): def __init__(self, maxsize: int = 0) -> None: ... else: - def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = ...) -> None: ... + def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = None) -> None: ... def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... diff --git a/stdlib/asyncio/streams.pyi b/stdlib/asyncio/streams.pyi index 091ad521bd2f..c09c1027eea8 100644 --- a/stdlib/asyncio/streams.pyi +++ b/stdlib/asyncio/streams.pyi @@ -78,21 +78,21 @@ if sys.version_info >= (3, 10): else: async def open_connection( - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> tuple[StreamReader, StreamWriter]: ... async def start_server( client_connected_cb: _ClientConnectedCallback, - host: str | None = ..., - port: int | str | None = ..., + host: str | None = None, + port: int | str | None = None, *, - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, ssl_handshake_timeout: float | None = ..., **kwds: Any, ) -> Server: ... diff --git a/stdlib/asyncio/subprocess.pyi b/stdlib/asyncio/subprocess.pyi index 690e792efe6f..b112a9d80a32 100644 --- a/stdlib/asyncio/subprocess.pyi +++ b/stdlib/asyncio/subprocess.pyi @@ -173,11 +173,11 @@ elif sys.version_info >= (3, 10): else: # >= 3.9 async def create_subprocess_shell( cmd: str | bytes, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + loop: events.AbstractEventLoop | None = None, + limit: int = 65536, *, # These parameters are forced to these values by BaseEventLoop.subprocess_shell universal_newlines: Literal[False] = ..., @@ -205,11 +205,11 @@ else: # >= 3.9 async def create_subprocess_exec( program: _ExecArg, *args: _ExecArg, - stdin: int | IO[Any] | None = ..., - stdout: int | IO[Any] | None = ..., - stderr: int | IO[Any] | None = ..., - loop: events.AbstractEventLoop | None = ..., - limit: int = ..., + stdin: int | IO[Any] | None = None, + stdout: int | IO[Any] | None = None, + stderr: int | IO[Any] | None = None, + 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] = ..., diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 114f8cd0e741..0b90fd90ff5b 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -55,7 +55,7 @@ if sys.version_info >= (3, 10): else: def as_completed( - fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ... + fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None ) -> Iterator[Future[_T]]: ... @overload @@ -145,15 +145,15 @@ if sys.version_info >= (3, 10): else: @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: Literal[False] = ... + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False ) -> Future[tuple[_T1]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2]]: ... @overload def gather( # type: ignore[misc] @@ -161,8 +161,8 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3]]: ... @overload def gather( # type: ignore[misc] @@ -171,8 +171,8 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... @overload def gather( # type: ignore[misc] @@ -182,19 +182,19 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., - return_exceptions: Literal[False] = ..., + loop: AbstractEventLoop | None = None, + return_exceptions: Literal[False] = False, ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... @overload def gather( # type: ignore[misc] - __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: bool + __coro_or_future1: _FutureLike[_T1], *, loop: AbstractEventLoop | None = None, return_exceptions: bool ) -> Future[tuple[_T1 | BaseException]]: ... @overload def gather( # type: ignore[misc] __coro_or_future1: _FutureLike[_T1], __coro_or_future2: _FutureLike[_T2], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... @overload @@ -203,7 +203,7 @@ else: __coro_or_future2: _FutureLike[_T2], __coro_or_future3: _FutureLike[_T3], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... @overload @@ -213,7 +213,7 @@ else: __coro_or_future3: _FutureLike[_T3], __coro_or_future4: _FutureLike[_T4], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... @overload @@ -224,14 +224,14 @@ else: __coro_or_future4: _FutureLike[_T4], __coro_or_future5: _FutureLike[_T5], *, - loop: AbstractEventLoop | None = ..., + loop: AbstractEventLoop | None = None, return_exceptions: bool, ) -> Future[ tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload def gather( # type: ignore[misc] - *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = ..., return_exceptions: bool = ... + *coros_or_futures: _FutureLike[Any], loop: AbstractEventLoop | None = None, return_exceptions: bool = False ) -> Future[list[Any]]: ... def run_coroutine_threadsafe(coro: _FutureLike[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... @@ -251,20 +251,20 @@ if sys.version_info >= (3, 10): async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... else: - def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ... + def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... @overload - async def sleep(delay: float, *, loop: AbstractEventLoop | None = ...) -> None: ... + async def sleep(delay: float, *, loop: AbstractEventLoop | None = None) -> None: ... @overload - async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = None) -> _T: ... @overload async def wait( # type: ignore[misc] - fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[_FT], *, loop: AbstractEventLoop | None = None, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' ) -> tuple[set[_FT], set[_FT]]: ... @overload async def wait( - fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ... + fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> _T: ... + async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = None) -> _T: ... # mypy and pyright complain that a subclass of an invariant class shouldn't be covariant. # While this is true in general, here it's sort-of okay to have a covariant subclass, diff --git a/stdlib/compileall.pyi b/stdlib/compileall.pyi index 613a2bc40987..d43811356c02 100644 --- a/stdlib/compileall.pyi +++ b/stdlib/compileall.pyi @@ -45,35 +45,35 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 9): def compile_dir( dir: StrPath, - maxlevels: int | None = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int | None = None, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # https://bugs.python.org/issue40447 - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, *, - stripdir: str | None = ..., # https://bugs.python.org/issue40447 - prependdir: StrPath | None = ..., - limit_sl_dest: StrPath | None = ..., - hardlink_dupes: bool = ..., + stripdir: str | None = None, # https://bugs.python.org/issue40447 + prependdir: StrPath | None = None, + limit_sl_dest: StrPath | None = None, + hardlink_dupes: bool = False, ) -> int: ... else: diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index 440347d99fc3..522285abbc72 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -186,7 +186,7 @@ else: class nullcontext(AbstractContextManager[_T]): enter_result: _T @overload - def __init__(self: nullcontext[None], enter_result: None = ...) -> None: ... + def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... def __enter__(self) -> _T: ... diff --git a/stdlib/dataclasses.pyi b/stdlib/dataclasses.pyi index 649084452eac..32b12ebab535 100644 --- a/stdlib/dataclasses.pyi +++ b/stdlib/dataclasses.pyi @@ -104,7 +104,7 @@ elif sys.version_info >= (3, 10): else: @overload def dataclass( - *, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., unsafe_hash: bool = ..., frozen: bool = ... + *, init: bool = True, repr: bool = True, eq: bool = True, order: bool = False, unsafe_hash: bool = False, frozen: bool = False ) -> Callable[[type[_T]], type[_T]]: ... # See https://github.com/python/mypy/issues/10750 @@ -191,30 +191,30 @@ else: def field( *, default: _T, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, default_factory: Callable[[], _T], - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> _T: ... @overload def field( *, - init: bool = ..., - repr: bool = ..., - hash: bool | None = ..., - compare: bool = ..., - metadata: Mapping[Any, Any] | None = ..., + init: bool = True, + repr: bool = True, + hash: bool | None = None, + compare: bool = True, + metadata: Mapping[Any, Any] | None = None, ) -> Any: ... def fields(class_or_instance: _DataclassInstance | type[_DataclassInstance]) -> tuple[Field[Any], ...]: ... @@ -286,13 +286,13 @@ else: fields: Iterable[str | tuple[str, type] | tuple[str, type, Any]], *, bases: tuple[type, ...] = ..., - namespace: dict[str, Any] | None = ..., - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., + namespace: dict[str, Any] | None = None, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> type: ... def replace(__obj: _DataclassT, **changes: Any) -> _DataclassT: ... diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index 66202e841d3c..99d63b3e18d1 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -9,9 +9,9 @@ if sys.platform == "win32": class PyDialog(Dialog): def __init__(self, *args, **kw) -> None: ... def title(self, title) -> None: ... - def back(self, title, next, name: str = ..., active: int = ...): ... - def cancel(self, title, next, name: str = ..., active: int = ...): ... - def next(self, title, next, name: str = ..., active: int = ...): ... + def back(self, title, next, name: str = 'Back', active: int = 1): ... + def cancel(self, title, next, name: str = 'Cancel', active: int = 1): ... + def next(self, title, next, name: str = 'Next', active: int = 1): ... def xbutton(self, name, title, next, xpos): ... class bdist_msi(Command): diff --git a/stdlib/distutils/command/bdist_wininst.pyi b/stdlib/distutils/command/bdist_wininst.pyi index 1091fb278493..8491d3126200 100644 --- a/stdlib/distutils/command/bdist_wininst.pyi +++ b/stdlib/distutils/command/bdist_wininst.pyi @@ -11,6 +11,6 @@ class bdist_wininst(Command): def finalize_options(self) -> None: ... def run(self) -> None: ... def get_inidata(self) -> str: ... - def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = ...) -> None: ... + def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = None) -> None: ... def get_installer_filename(self, fullname: str) -> str: ... def get_exe_bytes(self) -> bytes: ... diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index ad491df27a8b..d44e76224e98 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -72,30 +72,30 @@ elif sys.version_info >= (3, 8): # bufsize is dropped and mode and openhook become keyword-only @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... else: @@ -203,32 +203,32 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... else: diff --git a/stdlib/formatter.pyi b/stdlib/formatter.pyi index 388dbd6071ac..05c3c8b3dd41 100644 --- a/stdlib/formatter.pyi +++ b/stdlib/formatter.pyi @@ -8,11 +8,11 @@ _StylesType: TypeAlias = tuple[Any, ...] class NullFormatter: writer: NullWriter | None - def __init__(self, writer: NullWriter | None = ...) -> None: ... + def __init__(self, writer: NullWriter | None = None) -> None: ... def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def add_flowing_data(self, data: str) -> None: ... def add_literal_data(self, data: str) -> None: ... def flush_softspace(self) -> None: ... @@ -24,8 +24,8 @@ class NullFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class AbstractFormatter: writer: NullWriter @@ -45,7 +45,7 @@ class AbstractFormatter: def end_paragraph(self, blankline: int) -> None: ... def add_line_break(self) -> None: ... def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = ...) -> None: ... + def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... def format_counter(self, format: Iterable[str], counter: int) -> str: ... def format_letter(self, case: str, counter: int) -> str: ... def format_roman(self, case: str, counter: int) -> str: ... @@ -60,8 +60,8 @@ class AbstractFormatter: def pop_margin(self) -> None: ... def set_spacing(self, spacing: str | None) -> None: ... def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = ...) -> None: ... - def assert_line_data(self, flag: int = ...) -> None: ... + def pop_style(self, n: int = 1) -> None: ... + def assert_line_data(self, flag: int = 1) -> None: ... class NullWriter: def flush(self) -> None: ... @@ -82,7 +82,7 @@ class AbstractWriter(NullWriter): ... class DumbWriter(NullWriter): file: IO[str] maxcol: int - def __init__(self, file: IO[str] | None = ..., maxcol: int = ...) -> None: ... + def __init__(self, file: IO[str] | None = None, maxcol: int = 72) -> None: ... def reset(self) -> None: ... -def test(file: str | None = ...) -> None: ... +def test(file: str | None = None) -> None: ... diff --git a/stdlib/glob.pyi b/stdlib/glob.pyi index 3f37a99e8505..914ccc12ef1e 100644 --- a/stdlib/glob.pyi +++ b/stdlib/glob.pyi @@ -35,8 +35,8 @@ elif sys.version_info >= (3, 10): ) -> Iterator[AnyStr]: ... else: - def glob(pathname: AnyStr, *, recursive: bool = ...) -> list[AnyStr]: ... - def iglob(pathname: AnyStr, *, recursive: bool = ...) -> Iterator[AnyStr]: ... + def glob(pathname: AnyStr, *, recursive: bool = False) -> list[AnyStr]: ... + def iglob(pathname: AnyStr, *, recursive: bool = False) -> Iterator[AnyStr]: ... def escape(pathname: AnyStr) -> AnyStr: ... def has_magic(s: str | bytes) -> bool: ... # undocumented diff --git a/stdlib/inspect.pyi b/stdlib/inspect.pyi index a3d3e96c2217..3b82e0b0af2a 100644 --- a/stdlib/inspect.pyi +++ b/stdlib/inspect.pyi @@ -297,7 +297,7 @@ if sys.version_info >= (3, 10): ) -> Signature: ... else: - def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Signature: ... + def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Signature: ... class _void: ... class _empty: ... @@ -329,7 +329,7 @@ class Signature: ) -> Self: ... else: @classmethod - def from_callable(cls: type[Self], obj: _IntrospectableCallable, *, follow_wrapped: bool = ...) -> Self: ... + def from_callable(cls: type[Self], obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ... def __eq__(self, other: object) -> bool: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 6bfd92f1d3b2..795a0dd91a4d 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -347,7 +347,7 @@ class Formatter: ) -> None: ... elif sys.version_info >= (3, 8): def __init__( - self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ..., validate: bool = ... + self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = '%', validate: bool = True ) -> None: ... else: def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ... diff --git a/stdlib/logging/config.pyi b/stdlib/logging/config.pyi index 529dd65ff7cf..f76f655a6196 100644 --- a/stdlib/logging/config.pyi +++ b/stdlib/logging/config.pyi @@ -57,8 +57,8 @@ if sys.version_info >= (3, 10): else: def fileConfig( fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: dict[str, str] | None = ..., - disable_existing_loggers: bool = ..., + defaults: dict[str, str] | None = None, + disable_existing_loggers: bool = True, ) -> None: ... def valid_ident(s: str) -> Literal[True]: ... # undocumented diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index 9e56d9a8f25f..1cdc5e1e4a2e 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -197,7 +197,7 @@ class Path(PurePath): self, data: str, encoding: str | None = None, errors: str | None = None, newline: str | None = None ) -> int: ... else: - def write_text(self, data: str, encoding: str | None = ..., errors: str | None = ...) -> int: ... + def write_text(self, data: str, encoding: str | None = None, errors: str | None = None) -> int: ... if sys.version_info >= (3, 8) and sys.version_info < (3, 12): def link_to(self, target: StrOrBytesPath) -> None: ... if sys.version_info >= (3, 12): diff --git a/stdlib/pprint.pyi b/stdlib/pprint.pyi index c10f9a5a1662..3f49857a9999 100644 --- a/stdlib/pprint.pyi +++ b/stdlib/pprint.pyi @@ -21,12 +21,12 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 8): def pformat( object: object, - indent: int = ..., - width: int = ..., - depth: int | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> str: ... else: @@ -54,7 +54,7 @@ elif sys.version_info >= (3, 8): depth: int | None = ..., *, compact: bool = ..., - sort_dicts: bool = ..., + sort_dicts: bool = False, ) -> None: ... if sys.version_info >= (3, 10): @@ -73,13 +73,13 @@ if sys.version_info >= (3, 10): elif sys.version_info >= (3, 8): def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: @@ -113,13 +113,13 @@ class PrettyPrinter: elif sys.version_info >= (3, 8): def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., - sort_dicts: bool = ..., + compact: bool = False, + sort_dicts: bool = True, ) -> None: ... else: def __init__( diff --git a/stdlib/py_compile.pyi b/stdlib/py_compile.pyi index 80222021fbc2..c12b74328928 100644 --- a/stdlib/py_compile.pyi +++ b/stdlib/py_compile.pyi @@ -43,4 +43,4 @@ if sys.version_info >= (3, 10): def main() -> None: ... else: - def main(args: list[str] | None = ...) -> int: ... + def main(args: list[str] | None = None) -> int: ... diff --git a/stdlib/pyclbr.pyi b/stdlib/pyclbr.pyi index 8b1d923a753f..38658a03139c 100644 --- a/stdlib/pyclbr.pyi +++ b/stdlib/pyclbr.pyi @@ -31,7 +31,7 @@ class Class: ) -> None: ... else: def __init__( - self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = ... + self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = None ) -> None: ... class Function: @@ -60,7 +60,7 @@ class Function: end_lineno: int | None = None, ) -> None: ... else: - def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = ...) -> None: ... + def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = None) -> None: ... def readmodule(module: str, path: Sequence[str] | None = None) -> dict[str, Class]: ... def readmodule_ex(module: str, path: Sequence[str] | None = None) -> dict[str, Class | Function | list[str]]: ... diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index a9953a8eafc2..acfc46747dbc 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -528,13 +528,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -560,13 +560,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -592,13 +592,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -625,13 +625,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -657,13 +657,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -689,13 +689,13 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -956,7 +956,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., user: str | int | None = ..., group: str | int | None = ..., @@ -1498,7 +1498,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1527,7 +1527,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1556,7 +1556,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1586,7 +1586,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1615,7 +1615,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1644,7 +1644,7 @@ elif sys.version_info >= (3, 9): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -2227,176 +2227,176 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, ) -> None: ... else: @overload diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index e7a22def2020..242afeffe823 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -371,11 +371,11 @@ class TemporaryDirectory(Generic[AnyStr]): else: @overload def __init__( - self: TemporaryDirectory[str], suffix: str | None = ..., prefix: str | None = ..., dir: StrPath | None = ... + self: TemporaryDirectory[str], suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None ) -> None: ... @overload def __init__( - self: TemporaryDirectory[bytes], suffix: bytes | None = ..., prefix: bytes | None = ..., dir: BytesPath | None = ... + self: TemporaryDirectory[bytes], suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None ) -> None: ... def cleanup(self) -> None: ... diff --git a/stdlib/traceback.pyi b/stdlib/traceback.pyi index c2a4f377298e..cdda50c0a1b3 100644 --- a/stdlib/traceback.pyi +++ b/stdlib/traceback.pyi @@ -61,16 +61,16 @@ else: etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - file: SupportsWrite[str] | None = ..., - chain: bool = ..., + limit: int | None = None, + file: SupportsWrite[str] | None = None, + chain: bool = True, ) -> None: ... def format_exception( etype: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, - limit: int | None = ..., - chain: bool = ..., + limit: int | None = None, + chain: bool = True, ) -> list[str]: ... def print_exc(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... @@ -169,10 +169,10 @@ class TracebackException: exc_value: BaseException, exc_traceback: TracebackType | None, *, - limit: int | None = ..., - lookup_lines: bool = ..., - capture_locals: bool = ..., - _seen: set[int] | None = ..., + limit: int | None = None, + lookup_lines: bool = True, + capture_locals: bool = False, + _seen: set[int] | None = None, ) -> None: ... @classmethod def from_exception( diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 2443e8006058..7ecf4211a7d1 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -285,22 +285,22 @@ class CodeType: def replace( self, *, - co_argcount: int = ..., - co_posonlyargcount: int = ..., - co_kwonlyargcount: int = ..., - co_nlocals: int = ..., - co_stacksize: int = ..., - co_flags: int = ..., - co_firstlineno: int = ..., - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_lnotab: bytes = ..., + co_argcount: int = -1, + co_posonlyargcount: int = -1, + co_kwonlyargcount: int = -1, + co_nlocals: int = -1, + co_stacksize: int = -1, + co_flags: int = -1, + co_firstlineno: int = -1, + co_code: bytes = None, + co_consts: tuple[object, ...] = None, + co_names: tuple[str, ...] = None, + co_varnames: tuple[str, ...] = None, + co_freevars: tuple[str, ...] = None, + co_cellvars: tuple[str, ...] = None, + co_filename: str = None, + co_name: str = None, + co_lnotab: bytes = None, ) -> CodeType: ... @final diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 67fcc41ade71..a14e05912df8 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -408,7 +408,7 @@ if sys.version_info >= (3, 10): else: def create_autospec( - spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Any | None = ..., _name: Any | None = ..., **kwargs: Any + spec: Any, spec_set: Any = False, instance: Any = False, _parent: Any | None = None, _name: Any | None = None, **kwargs: Any ) -> Any: ... class _SpecState: From c6760712a4604cf568df857e3fc9f0d499275446 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Jan 2023 23:54:49 +0000 Subject: [PATCH 03/13] py38 branches --- stdlib/_dummy_thread.pyi | 6 +- stdlib/_dummy_threading.pyi | 40 ++-- stdlib/aifc.pyi | 2 +- stdlib/argparse.pyi | 20 +- stdlib/ast.pyi | 2 +- stdlib/asyncio/tasks.pyi | 4 +- stdlib/bz2.pyi | 8 +- stdlib/compileall.pyi | 32 +-- stdlib/concurrent/futures/_base.pyi | 2 +- stdlib/concurrent/futures/process.pyi | 2 +- stdlib/ftplib.pyi | 26 +-- stdlib/imaplib.pyi | 18 +- stdlib/logging/__init__.pyi | 2 +- stdlib/logging/handlers.pyi | 28 +-- stdlib/nntplib.pyi | 2 +- stdlib/plistlib.pyi | 8 +- stdlib/random.pyi | 2 +- stdlib/smtplib.pyi | 2 +- stdlib/subprocess.pyi | 270 +++++++++++++------------- stdlib/tkinter/colorchooser.pyi | 2 +- stdlib/typing.pyi | 4 +- stdlib/urllib/parse.pyi | 2 +- stdlib/uuid.pyi | 2 +- stdlib/venv/__init__.pyi | 22 +-- stdlib/xml/dom/minidom.pyi | 12 +- stdlib/xml/etree/ElementInclude.pyi | 2 +- stdlib/xml/etree/ElementTree.pyi | 4 +- 27 files changed, 263 insertions(+), 263 deletions(-) diff --git a/stdlib/_dummy_thread.pyi b/stdlib/_dummy_thread.pyi index ff16b1d3dcf4..e371dd0e9933 100644 --- a/stdlib/_dummy_thread.pyi +++ b/stdlib/_dummy_thread.pyi @@ -11,12 +11,12 @@ def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwa def exit() -> NoReturn: ... def get_ident() -> int: ... def allocate_lock() -> LockType: ... -def stack_size(size: int | None = ...) -> int: ... +def stack_size(size: int | None = None) -> int: ... class LockType: locked_status: bool - def acquire(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... - def __enter__(self, waitflag: bool | None = ..., timeout: int = ...) -> bool: ... + def acquire(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... + def __enter__(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... def release(self) -> bool: ... def locked(self) -> bool: ... diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index 8f7f5a9b994c..d5a42018bb0d 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) -> int: ... TIMEOUT_MAX: float @@ -59,17 +59,17 @@ class Thread: def ident(self) -> int | None: ... def __init__( self, - group: None = ..., - target: Callable[..., object] | None = ..., - name: str | None = ..., + group: None = None, + target: Callable[..., object] | None = None, + name: str | None = None, args: Iterable[Any] = ..., - kwargs: Mapping[str, Any] | None = ..., + kwargs: Mapping[str, Any] | None = None, *, - daemon: bool | None = ..., + daemon: bool | None = None, ) -> None: ... def start(self) -> None: ... def run(self) -> None: ... - def join(self, timeout: float | None = ...) -> None: ... + def join(self, timeout: float | None = None) -> None: ... def getName(self) -> str: ... def setName(self, name: str) -> None: ... if sys.version_info >= (3, 8): @@ -99,32 +99,32 @@ class _RLock: def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... RLock = _RLock class Condition: - def __init__(self, lock: Lock | _RLock | None = ...) -> None: ... + def __init__(self, lock: Lock | _RLock | None = None) -> None: ... def __enter__(self) -> bool: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... def release(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... - def wait_for(self, predicate: Callable[[], _T], timeout: float | None = ...) -> _T: ... - def notify(self, n: int = ...) -> None: ... + def wait(self, timeout: float | None = None) -> bool: ... + def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ... + def notify(self, n: int = 1) -> None: ... def notify_all(self) -> None: ... def notifyAll(self) -> None: ... class Semaphore: - def __init__(self, value: int = ...) -> None: ... + def __init__(self, value: int = 1) -> None: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... - def __enter__(self, blocking: bool = ..., timeout: float | None = ...) -> bool: ... + def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 9): def release(self, n: int = ...) -> None: ... else: @@ -136,7 +136,7 @@ class Event: def is_set(self) -> bool: ... def set(self) -> None: ... def clear(self) -> None: ... - def wait(self, timeout: float | None = ...) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: ... if sys.version_info >= (3, 8): from _thread import _excepthook, _ExceptHookArgs @@ -149,8 +149,8 @@ class Timer(Thread): self, interval: float, function: Callable[..., object], - args: Iterable[Any] | None = ..., - kwargs: Mapping[str, Any] | None = ..., + args: Iterable[Any] | None = None, + kwargs: Mapping[str, Any] | None = None, ) -> None: ... def cancel(self) -> None: ... @@ -161,8 +161,8 @@ class Barrier: def n_waiting(self) -> int: ... @property def broken(self) -> bool: ... - def __init__(self, parties: int, action: Callable[[], None] | None = ..., timeout: float | None = ...) -> None: ... - def wait(self, timeout: float | None = ...) -> int: ... + def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ... + def wait(self, timeout: float | None = None) -> int: ... def reset(self) -> None: ... def abort(self) -> None: ... diff --git a/stdlib/aifc.pyi b/stdlib/aifc.pyi index afb640e04fd7..ad126d6cdbef 100644 --- a/stdlib/aifc.pyi +++ b/stdlib/aifc.pyi @@ -89,4 +89,4 @@ if sys.version_info < (3, 9): @overload def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... @overload - def openfp(f: _File, mode: str | None = ...) -> Any: ... + def openfp(f: _File, mode: str | None = None) -> Any: ... diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index 269df8efe255..8f2e9f5822fb 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -148,18 +148,18 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): else: def __init__( self, - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., + prog: str | None = None, + usage: str | None = None, + description: str | None = None, + epilog: str | None = None, parents: Sequence[ArgumentParser] = ..., formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., + prefix_chars: str = '-', + fromfile_prefix_chars: str | None = None, + argument_default: Any = None, + conflict_handler: str = 'error', + add_help: bool = True, + allow_abbrev: bool = True, ) -> None: ... # The type-ignores in these overloads should be temporary. See: # https://github.com/python/typeshed/pull/2643#issuecomment-442280277 diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index 53df5025f255..1a590b2a93dc 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -272,7 +272,7 @@ if sys.version_info >= (3, 9): ) -> str: ... else: - def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ... + def dump(node: AST, annotate_fields: bool = True, include_attributes: bool = False) -> str: ... def fix_missing_locations(node: _T) -> _T: ... def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = True) -> str | None: ... diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 0b90fd90ff5b..bc6502140bd8 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -295,9 +295,9 @@ class Task(Future[_T_co], Generic[_T_co]): # type: ignore[type-var] # pyright: def uncancel(self) -> int: ... if sys.version_info < (3, 9): @classmethod - def current_task(cls, loop: AbstractEventLoop | None = ...) -> Task[Any] | None: ... + def current_task(cls, loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... @classmethod - def all_tasks(cls, loop: AbstractEventLoop | None = ...) -> set[Task[Any]]: ... + def all_tasks(cls, loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index db2602e2671a..dee6ed78a37a 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -105,19 +105,19 @@ class BZ2File(BaseStream, IO[bytes]): else: @overload def __init__( - self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = ..., compresslevel: int = ... + self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = ..., compresslevel: int = 9 ) -> None: ... @overload def __init__( - self, filename: _ReadableFileobj, mode: _ReadBinaryMode = ..., buffering: Any | None = ..., compresslevel: int = ... + self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', buffering: Any | None = ..., compresslevel: int = 9 ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = ..., + mode: _ReadBinaryMode | _WriteBinaryMode = 'r', buffering: Any | None = ..., - compresslevel: int = ..., + compresslevel: int = 9, ) -> None: ... def read(self, size: int | None = -1) -> bytes: ... diff --git a/stdlib/compileall.pyi b/stdlib/compileall.pyi index d43811356c02..7520c2f5b676 100644 --- a/stdlib/compileall.pyi +++ b/stdlib/compileall.pyi @@ -79,25 +79,25 @@ elif sys.version_info >= (3, 9): else: def compile_dir( dir: StrPath, - maxlevels: int = ..., - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - workers: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + maxlevels: int = 10, + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + workers: int = 1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_file( fullname: StrPath, - ddir: StrPath | None = ..., - force: bool = ..., - rx: _SupportsSearch | None = ..., - quiet: int = ..., - legacy: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + ddir: StrPath | None = None, + force: bool = False, + rx: _SupportsSearch | None = None, + quiet: int = 0, + legacy: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> int: ... def compile_path( diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 4a044bc761a3..64084a884433 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -60,7 +60,7 @@ class Executor: if sys.version_info >= (3, 9): def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... else: - def shutdown(self, wait: bool = ...) -> None: ... + def shutdown(self, wait: bool = True) -> None: ... def __enter__(self: Self) -> Self: ... def __exit__( diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index 54c50a328604..85af2e7f84c7 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -83,7 +83,7 @@ class _SafeQueue(Queue[Future[Any]]): ) -> None: ... else: def __init__( - self, max_size: int | None = ..., *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] + self, max_size: int | None = 0, *, ctx: BaseContext, pending_work_items: dict[int, _WorkItem[Any]] ) -> None: ... def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 4a735ab4bef6..0aa70a43a8de 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -56,12 +56,12 @@ class FTP: else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., + host: str = '', + user: str = '', + passwd: str = '', + acct: str = '', timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... def connect( @@ -136,15 +136,15 @@ class FTP_TLS(FTP): else: def __init__( self, - host: str = ..., - user: str = ..., - passwd: str = ..., - acct: str = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - context: SSLContext | None = ..., + host: str = '', + user: str = '', + passwd: str = '', + acct: str = '', + keyfile: str | None = None, + certfile: str | None = None, + context: SSLContext | None = None, timeout: float = ..., - source_address: tuple[str, int] | None = ..., + source_address: tuple[str, int] | None = None, ) -> None: ... ssl_version: int keyfile: str | None diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index f6ed8de48b8b..4f187455e18f 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -44,8 +44,8 @@ class IMAP4: def __init__(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... def open(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... else: - def __init__(self, host: str = ..., port: int = ...) -> None: ... - def open(self, host: str = ..., port: int = ...) -> None: ... + def __init__(self, host: str = '', port: int = 143) -> None: ... + def open(self, host: str = '', port: int = 143) -> None: ... def __getattr__(self, attr: str) -> Any: ... host: str @@ -123,18 +123,18 @@ class IMAP4_SSL(IMAP4): else: def __init__( self, - host: str = ..., - port: int = ..., - keyfile: str | None = ..., - certfile: str | None = ..., - ssl_context: SSLContext | None = ..., + host: str = '', + port: int = 993, + keyfile: str | None = None, + certfile: str | None = None, + ssl_context: SSLContext | None = None, ) -> None: ... sslobj: SSLSocket file: IO[Any] if sys.version_info >= (3, 9): def open(self, host: str = "", port: int | None = 993, timeout: float | None = None) -> None: ... else: - def open(self, host: str = ..., port: int | None = ...) -> None: ... + def open(self, host: str = '', port: int | None = 993) -> None: ... def ssl(self) -> SSLSocket: ... @@ -148,7 +148,7 @@ class IMAP4_stream(IMAP4): if sys.version_info >= (3, 9): def open(self, host: str | None = None, port: int | None = None, timeout: float | None = None) -> None: ... else: - def open(self, host: str | None = ..., port: int | None = ...) -> None: ... + def open(self, host: str | None = None, port: int | None = None) -> None: ... class _Authenticator: mech: Callable[[bytes], bytes | bytearray | memoryview | str | None] diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index 795a0dd91a4d..c6510a270cf7 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -789,7 +789,7 @@ class FileHandler(StreamHandler[TextIOWrapper]): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = 'a', encoding: str | None = None, delay: bool = False) -> None: ... def _open(self) -> TextIOWrapper: ... # undocumented diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index f8f93b5a91f0..52a6a3dfbede 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -25,7 +25,7 @@ class WatchedFileHandler(FileHandler): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = ..., encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str = 'a', encoding: str | None = None, delay: bool = False) -> None: ... def _statstream(self) -> None: ... # undocumented def reopenIfNeeded(self) -> None: ... @@ -38,7 +38,7 @@ class BaseRotatingHandler(FileHandler): self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str, encoding: str | None = ..., delay: bool = ...) -> None: ... + def __init__(self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False) -> None: ... def rotation_filename(self, default_name: str) -> str: ... def rotate(self, source: str, dest: str) -> None: ... @@ -61,11 +61,11 @@ class RotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - mode: str = ..., - maxBytes: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., + mode: str = 'a', + maxBytes: int = 0, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, ) -> None: ... def doRollover(self) -> None: ... @@ -98,13 +98,13 @@ class TimedRotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - when: str = ..., - interval: int = ..., - backupCount: int = ..., - encoding: str | None = ..., - delay: bool = ..., - utc: bool = ..., - atTime: datetime.time | None = ..., + when: str = 'h', + interval: int = 1, + backupCount: int = 0, + encoding: str | None = None, + delay: bool = False, + utc: bool = False, + atTime: datetime.time | None = None, ) -> None: ... def doRollover(self) -> None: ... diff --git a/stdlib/nntplib.pyi b/stdlib/nntplib.pyi index 12d105a68150..02e743ea9d1e 100644 --- a/stdlib/nntplib.pyi +++ b/stdlib/nntplib.pyi @@ -99,7 +99,7 @@ class NNTP: self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = None ) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... if sys.version_info < (3, 9): - def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ... + def xgtitle(self, group: str, *, file: _File = None) -> tuple[str, _list[tuple[str, str]]]: ... def xpath(self, id: Any) -> tuple[str, str]: ... def date(self) -> tuple[str, datetime.datetime]: ... diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index 583c89ab4ca8..54ce3dc61abc 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -56,15 +56,15 @@ else: def load( fp: IO[bytes], *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... def loads( value: ReadableBuffer, *, - fmt: PlistFormat | None = ..., - use_builtin_types: bool = ..., + fmt: PlistFormat | None = None, + use_builtin_types: bool = True, dict_type: type[MutableMapping[str, Any]] = ..., ) -> Any: ... diff --git a/stdlib/random.pyi b/stdlib/random.pyi index ae67e988d7bb..10086efad0fe 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -46,7 +46,7 @@ class Random(_random.Random): if sys.version_info >= (3, 9): def seed(self, a: int | float | str | bytes | bytearray | None = None, version: int = 2) -> None: ... # type: ignore[override] # noqa: Y041 else: - def seed(self, a: Any = ..., version: int = ...) -> None: ... + def seed(self, a: Any = None, version: int = 2) -> None: ... def getstate(self) -> tuple[Any, ...]: ... def setstate(self, state: tuple[Any, ...]) -> None: ... diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index b4642aa587a4..166674f42097 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -178,5 +178,5 @@ class LMTP(SMTP): ) -> None: ... else: def __init__( - self, host: str = ..., port: int = ..., local_hostname: str | None = ..., source_address: _SourceAddress | None = ... + self, host: str = '', port: int = 2003, local_hostname: str | None = None, source_address: _SourceAddress | None = None ) -> None: ... diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index acfc46747dbc..c62c264269e4 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -723,13 +723,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -751,13 +751,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -779,13 +779,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -808,13 +808,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[str]: ... @overload def run( @@ -836,13 +836,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[bytes]: ... @overload def run( @@ -864,13 +864,13 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, ) -> CompletedProcess[Any]: ... # Same args as Popen.__init__ @@ -984,7 +984,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, text: bool | None = ..., ) -> int: ... @@ -1675,7 +1675,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1700,7 +1700,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1725,7 +1725,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1751,7 +1751,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1776,7 +1776,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1801,7 +1801,7 @@ else: start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -2403,152 +2403,152 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., + encoding: str | None = None, + errors: str | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, ) -> None: ... def poll(self) -> int | None: ... diff --git a/stdlib/tkinter/colorchooser.pyi b/stdlib/tkinter/colorchooser.pyi index d93a059f4144..4300d94f58e8 100644 --- a/stdlib/tkinter/colorchooser.pyi +++ b/stdlib/tkinter/colorchooser.pyi @@ -16,5 +16,5 @@ if sys.version_info >= (3, 9): else: def askcolor( - color: str | bytes | None = ..., *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... + color: str | bytes | None = None, *, initialcolor: _Color = ..., parent: Misc = ..., title: str = ... ) -> tuple[None, None] | tuple[tuple[float, float, float], str]: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 9670c9d6a74a..e6a1f6213383 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -737,7 +737,7 @@ if sys.version_info >= (3, 9): else: def get_type_hints( - obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = ..., localns: dict[str, Any] | None = ... + obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None ) -> dict[str, Any]: ... if sys.version_info >= (3, 8): @@ -825,7 +825,7 @@ class ForwardRef: # The module and is_class arguments were added in later Python 3.9 versions. def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ... else: - def __init__(self, arg: str, is_argument: bool = ...) -> None: ... + def __init__(self, arg: str, is_argument: bool = True) -> None: ... if sys.version_info >= (3, 9): def _evaluate( diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index f1ae62237d71..42b23335421f 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -145,7 +145,7 @@ if sys.version_info >= (3, 9): def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... else: - def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ... + def unquote(string: str, encoding: str = 'utf-8', errors: str = 'replace') -> str: ... def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ... def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... diff --git a/stdlib/uuid.pyi b/stdlib/uuid.pyi index 1fed902c9f6b..249257783626 100644 --- a/stdlib/uuid.pyi +++ b/stdlib/uuid.pyi @@ -70,7 +70,7 @@ if sys.version_info >= (3, 9): def getnode() -> int: ... else: - def getnode(*, getters: Unused = ...) -> int: ... # undocumented + def getnode(*, getters: Unused = None) -> int: ... # undocumented def uuid1(node: _Int | None = None, clock_seq: _Int | None = None) -> UUID: ... def uuid3(namespace: UUID, name: str) -> UUID: ... diff --git a/stdlib/venv/__init__.pyi b/stdlib/venv/__init__.pyi index 4d67a53ee602..f184649f10f0 100644 --- a/stdlib/venv/__init__.pyi +++ b/stdlib/venv/__init__.pyi @@ -31,12 +31,12 @@ class EnvBuilder: else: def __init__( self, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - upgrade: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + upgrade: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... def create(self, env_dir: StrOrBytesPath) -> None: ... @@ -69,11 +69,11 @@ if sys.version_info >= (3, 9): else: def create( env_dir: StrOrBytesPath, - system_site_packages: bool = ..., - clear: bool = ..., - symlinks: bool = ..., - with_pip: bool = ..., - prompt: str | None = ..., + system_site_packages: bool = False, + clear: bool = False, + symlinks: bool = False, + with_pip: bool = False, + prompt: str | None = None, ) -> None: ... def main(args: Sequence[str] | None = None) -> None: ... diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index 7b008f30144f..cbe81cb01e73 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -29,8 +29,8 @@ class Node(xml.dom.Node): self, indent: str = "\t", newl: str = "\n", encoding: str | None = None, standalone: bool | None = None ): ... else: - def toxml(self, encoding: str | None = ...): ... - def toprettyxml(self, indent: str = ..., newl: str = ..., encoding: str | None = ...): ... + def toxml(self, encoding: str | None = None): ... + def toprettyxml(self, indent: str = '\t', newl: str = '\n', encoding: str | None = None): ... def hasChildNodes(self) -> bool: ... def insertBefore(self, newChild, refChild): ... @@ -333,10 +333,10 @@ class Document(Node, DocumentLS): def writexml( self, writer: SupportsWrite[str], - indent: str = ..., - addindent: str = ..., - newl: str = ..., - encoding: Incomplete | None = ..., + indent: str = '', + addindent: str = '', + newl: str = '', + encoding: Incomplete | None = None, ) -> None: ... def renameNode(self, n, namespaceURI: str, name): ... diff --git a/stdlib/xml/etree/ElementInclude.pyi b/stdlib/xml/etree/ElementInclude.pyi index e04cef122ad2..cbba15dd3ebe 100644 --- a/stdlib/xml/etree/ElementInclude.pyi +++ b/stdlib/xml/etree/ElementInclude.pyi @@ -25,4 +25,4 @@ if sys.version_info >= (3, 9): class LimitedRecursiveIncludeError(FatalIncludeError): ... else: - def include(elem: Element, loader: Callable[..., str | Element] | None = ...) -> None: ... + def include(elem: Element, loader: Callable[..., str | Element] | None = None) -> None: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 9c1386313c24..0d2656f9f4f2 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -126,7 +126,7 @@ class Element: def __setitem__(self, __s: slice, __o: Iterable[Element]) -> None: ... if sys.version_info < (3, 9): def getchildren(self) -> list[Element]: ... - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ... def Comment(text: str | None = None) -> Element: ... @@ -149,7 +149,7 @@ class ElementTree: def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ... def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... if sys.version_info < (3, 9): - def getiterator(self, tag: str | None = ...) -> list[Element]: ... + def getiterator(self, tag: str | None = None) -> list[Element]: ... def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... @overload From 085b73b5433062fd64f07711181a1a7c12db79cb Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Jan 2023 23:56:56 +0000 Subject: [PATCH 04/13] py37 branches --- stdlib/ast.pyi | 4 +- stdlib/asyncio/base_events.pyi | 38 +++++------ stdlib/asyncio/events.pyi | 38 +++++------ stdlib/asyncio/futures.pyi | 2 +- stdlib/asyncio/runners.pyi | 2 +- stdlib/builtins.pyi | 4 +- stdlib/bz2.pyi | 6 +- stdlib/cgi.pyi | 2 +- stdlib/collections/__init__.pyi | 4 +- stdlib/ctypes/__init__.pyi | 2 +- stdlib/datetime.pyi | 2 +- stdlib/fileinput.pyi | 72 ++++++++++----------- stdlib/functools.pyi | 2 +- stdlib/gettext.pyi | 10 +-- stdlib/gzip.pyi | 2 +- stdlib/hmac.pyi | 2 +- stdlib/http/cookiejar.pyi | 26 ++++---- stdlib/logging/__init__.pyi | 16 ++--- stdlib/mimetypes.pyi | 4 +- stdlib/modulefinder.pyi | 4 +- stdlib/multiprocessing/reduction.pyi | 2 +- stdlib/os/__init__.pyi | 10 +-- stdlib/pickle.pyi | 8 +-- stdlib/platform.pyi | 10 +-- stdlib/pprint.pyi | 22 +++---- stdlib/py_compile.pyi | 10 +-- stdlib/pyexpat/__init__.pyi | 2 +- stdlib/shutil.pyi | 8 +-- stdlib/sre_parse.pyi | 4 +- stdlib/symtable.pyi | 2 +- stdlib/tempfile.pyi | 94 ++++++++++++++-------------- stdlib/tkinter/ttk.pyi | 2 +- stdlib/xml/etree/ElementTree.pyi | 12 ++-- stdlib/xmlrpc/client.pyi | 18 +++--- stdlib/zipfile.pyi | 10 +-- 35 files changed, 228 insertions(+), 228 deletions(-) diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index 1a590b2a93dc..3d9d3bfb60c1 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -244,7 +244,7 @@ if sys.version_info >= (3, 8): else: @overload def parse( - source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = ..., mode: Literal["exec"] = ... + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = '', mode: Literal["exec"] = 'exec' ) -> Module: ... @overload def parse( @@ -259,7 +259,7 @@ else: @overload def parse(source: str | ReadableBuffer, *, mode: Literal["single"]) -> Interactive: ... @overload - def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = ..., mode: str = ...) -> AST: ... + def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = '', mode: str = 'exec') -> AST: ... if sys.version_info >= (3, 9): def unparse(ast_obj: AST) -> str: ... diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 1e8d26952d5a..82dcd814b542 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -193,33 +193,33 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 14db489a0096..79075748c4ee 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -289,34 +289,34 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, ) -> tuple[Transport, _ProtocolT]: ... if sys.version_info >= (3, 11): @overload diff --git a/stdlib/asyncio/futures.pyi b/stdlib/asyncio/futures.pyi index 9ae1fe6bd50e..f325272d2403 100644 --- a/stdlib/asyncio/futures.pyi +++ b/stdlib/asyncio/futures.pyi @@ -44,7 +44,7 @@ class Future(Awaitable[_T], Iterable[_T]): def get_loop(self) -> AbstractEventLoop: ... @property def _callbacks(self: Self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = ...) -> None: ... + def add_done_callback(self: Self, __fn: Callable[[Self], object], *, context: Context | None = None) -> None: ... if sys.version_info >= (3, 9): def cancel(self, msg: Any | None = None) -> bool: ... else: diff --git a/stdlib/asyncio/runners.pyi b/stdlib/asyncio/runners.pyi index e85d291a7382..484f9eb831a1 100644 --- a/stdlib/asyncio/runners.pyi +++ b/stdlib/asyncio/runners.pyi @@ -32,4 +32,4 @@ elif sys.version_info >= (3, 8): def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ... else: - def run(main: Coroutine[Any, Any, _T], *, debug: bool = ...) -> _T: ... + def run(main: Coroutine[Any, Any, _T], *, debug: bool = False) -> _T: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index ea38a5ae90fe..c46fa067d405 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -437,9 +437,9 @@ class str(Sequence[str]): def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] else: @overload - def expandtabs(self: LiteralString, tabsize: int = ...) -> LiteralString: ... + def expandtabs(self: LiteralString, tabsize: int = 8) -> LiteralString: ... @overload - def expandtabs(self, tabsize: int = ...) -> str: ... # type: ignore[misc] + def expandtabs(self, tabsize: int = 8) -> str: ... # type: ignore[misc] def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... @overload diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index dee6ed78a37a..489b3bdab159 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -105,18 +105,18 @@ class BZ2File(BaseStream, IO[bytes]): else: @overload def __init__( - self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = ..., compresslevel: int = 9 + self, filename: _WritableFileobj, mode: _WriteBinaryMode, buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( - self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', buffering: Any | None = ..., compresslevel: int = 9 + self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = 'r', - buffering: Any | None = ..., + buffering: Any | None = None, compresslevel: int = 9, ) -> None: ... diff --git a/stdlib/cgi.pyi b/stdlib/cgi.pyi index 76e7a348335c..4780969f042b 100644 --- a/stdlib/cgi.pyi +++ b/stdlib/cgi.pyi @@ -52,7 +52,7 @@ def print_directory() -> None: ... def print_environ_usage() -> None: ... if sys.version_info < (3, 8): - def escape(s: str, quote: bool | None = ...) -> str: ... + def escape(s: str, quote: bool | None = None) -> str: ... class MiniFieldStorage: # The first five "Any" attributes here are always None, but mypy doesn't support that diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 3c6018095c95..6e3485d35483 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -167,7 +167,7 @@ class UserString(Sequence[UserString]): if sys.version_info >= (3, 8): def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ... else: - def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ... + def encode(self: Self, encoding: str | None = None, errors: str | None = None) -> Self: ... def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... def expandtabs(self: Self, tabsize: int = 8) -> Self: ... @@ -196,7 +196,7 @@ class UserString(Sequence[UserString]): def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... @staticmethod @overload - def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ... + def maketrans(x: str, y: str, z: str = None) -> dict[int, int | None]: ... def partition(self, sep: str) -> tuple[str, str, str]: ... if sys.version_info >= (3, 9): def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index c217bc3952c2..ad9bb0c063fa 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -33,7 +33,7 @@ class CDLL: ) -> None: ... else: def __init__( - self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ... + self, name: str | None, mode: int = 0, handle: int | None = None, use_errno: bool = False, use_last_error: bool = False ) -> None: ... def __getattr__(self, name: str) -> _NamedFuncPointer: ... diff --git a/stdlib/datetime.pyi b/stdlib/datetime.pyi index d9ef2dbd236e..377ef0067485 100644 --- a/stdlib/datetime.pyi +++ b/stdlib/datetime.pyi @@ -265,7 +265,7 @@ class datetime(date): else: @overload @classmethod - def now(cls: type[Self], tz: None = ...) -> Self: ... + def now(cls: type[Self], tz: None = None) -> Self: ... @overload @classmethod def now(cls, tz: _TzInfo) -> datetime: ... diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index d44e76224e98..2fa85b57d0b7 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -101,24 +101,24 @@ elif sys.version_info >= (3, 8): else: @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( @@ -127,17 +127,17 @@ else: backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> FileInput[bytes]: ... @overload def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... @overload def input( @@ -146,7 +146,7 @@ else: backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> FileInput[Any]: ... def close() -> None: ... @@ -235,25 +235,25 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): @overload def __init__( self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., - mode: _TextMode = ..., - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, + mode: _TextMode = 'r', + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... # Because mode isn't keyword-only here yet, we need two overloads each for # the bytes case and the fallback case. @overload def __init__( self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, *, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( @@ -263,18 +263,18 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, ) -> None: ... @overload def __init__( self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ..., - inplace: bool = ..., - backup: str = ..., - bufsize: int = ..., + files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, + inplace: bool = False, + backup: str = '', + bufsize: int = 0, *, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... @overload def __init__( @@ -284,7 +284,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): backup: str, bufsize: int, mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = ..., + openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, ) -> None: ... def __del__(self) -> None: ... diff --git a/stdlib/functools.pyi b/stdlib/functools.pyi index 976cb082e4f9..b0ed37ff8615 100644 --- a/stdlib/functools.pyi +++ b/stdlib/functools.pyi @@ -60,7 +60,7 @@ if sys.version_info >= (3, 8): def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ... else: - def lru_cache(maxsize: int | None = ..., typed: bool = ...) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... + def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... WRAPPER_ASSIGNMENTS: tuple[ Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"], diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 5506fbad4a72..85b673db306a 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -114,7 +114,7 @@ else: languages: Iterable[str] | None = None, class_: None = None, fallback: Literal[False] = False, - codeset: str | None = ..., + codeset: str | None = None, ) -> GNUTranslations: ... @overload def translation( @@ -124,7 +124,7 @@ else: *, class_: Callable[[io.BufferedReader], _NullTranslationsT], fallback: Literal[False] = False, - codeset: str | None = ..., + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( @@ -133,7 +133,7 @@ else: languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], fallback: Literal[False] = False, - codeset: str | None = ..., + codeset: str | None = None, ) -> _NullTranslationsT: ... @overload def translation( @@ -142,10 +142,10 @@ else: languages: Iterable[str] | None = None, class_: Callable[[io.BufferedReader], NullTranslations] | None = None, fallback: bool = False, - codeset: str | None = ..., + codeset: str | None = None, ) -> NullTranslations: ... def install( - domain: str, localedir: StrPath | None = None, codeset: str | None = ..., names: Container[str] | None = None + domain: str, localedir: StrPath | None = None, codeset: str | None = None, names: Container[str] | None = None ) -> None: ... def textdomain(domain: str | None = None) -> str: ... diff --git a/stdlib/gzip.pyi b/stdlib/gzip.pyi index f61d36f05d10..cacfce4ab128 100644 --- a/stdlib/gzip.pyi +++ b/stdlib/gzip.pyi @@ -162,6 +162,6 @@ if sys.version_info >= (3, 8): def compress(data: _BufferWithLen, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ... else: - def compress(data: _BufferWithLen, compresslevel: int = ...) -> bytes: ... + def compress(data: _BufferWithLen, compresslevel: int = 9) -> bytes: ... def decompress(data: ReadableBuffer) -> bytes: ... diff --git a/stdlib/hmac.pyi b/stdlib/hmac.pyi index 98fdfce561fe..b9a867f7bd61 100644 --- a/stdlib/hmac.pyi +++ b/stdlib/hmac.pyi @@ -23,7 +23,7 @@ if sys.version_info >= (3, 8): def new(key: bytes | bytearray, *, digestmod: _DigestMod) -> HMAC: ... else: - def new(key: bytes | bytearray, msg: ReadableBuffer | None = ..., digestmod: _DigestMod | None = ...) -> HMAC: ... + def new(key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod | None = None) -> HMAC: ... class HMAC: digest_size: int diff --git a/stdlib/http/cookiejar.pyi b/stdlib/http/cookiejar.pyi index 40cc5ab46ba6..7f2c9c6cc8f4 100644 --- a/stdlib/http/cookiejar.pyi +++ b/stdlib/http/cookiejar.pyi @@ -49,7 +49,7 @@ class FileCookieJar(CookieJar): self, filename: StrPath | None = None, delayload: bool = False, policy: CookiePolicy | None = None ) -> None: ... else: - def __init__(self, filename: str | None = ..., delayload: bool = ..., policy: CookiePolicy | None = ...) -> None: ... + def __init__(self, filename: str | None = None, delayload: bool = False, policy: CookiePolicy | None = None) -> None: ... def save(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... def load(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... @@ -104,18 +104,18 @@ class DefaultCookiePolicy(CookiePolicy): else: def __init__( self, - blocked_domains: Sequence[str] | None = ..., - allowed_domains: Sequence[str] | None = ..., - netscape: bool = ..., - rfc2965: bool = ..., - rfc2109_as_netscape: bool | None = ..., - hide_cookie2: bool = ..., - strict_domain: bool = ..., - strict_rfc2965_unverifiable: bool = ..., - strict_ns_unverifiable: bool = ..., - strict_ns_domain: int = ..., - strict_ns_set_initial_dollar: bool = ..., - strict_ns_set_path: bool = ..., + blocked_domains: Sequence[str] | None = None, + allowed_domains: Sequence[str] | None = None, + netscape: bool = True, + rfc2965: bool = False, + rfc2109_as_netscape: bool | None = None, + hide_cookie2: bool = False, + strict_domain: bool = False, + strict_rfc2965_unverifiable: bool = True, + strict_ns_unverifiable: bool = False, + strict_ns_domain: int = 0, + strict_ns_set_initial_dollar: bool = False, + strict_ns_set_path: bool = False, ) -> None: ... def blocked_domains(self) -> tuple[str, ...]: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index c6510a270cf7..a32328d21c71 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -257,7 +257,7 @@ class Logger(Filterer): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., + exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ..., ) -> None: ... @@ -266,9 +266,9 @@ class Logger(Filterer): level: int, msg: object, args: _ArgsType, - exc_info: _ExcInfoType | None = ..., - extra: Mapping[str, object] | None = ..., - stack_info: bool = ..., + exc_info: _ExcInfoType | None = None, + extra: Mapping[str, object] | None = None, + stack_info: bool = False, ) -> None: ... # undocumented fatal = critical def addHandler(self, hdlr: Handler) -> None: ... @@ -276,7 +276,7 @@ class Logger(Filterer): if sys.version_info >= (3, 8): def findCaller(self, stack_info: bool = False, stacklevel: int = 1) -> tuple[str, int, str, str | None]: ... else: - def findCaller(self, stack_info: bool = ...) -> tuple[str, int, str, str | None]: ... + def findCaller(self, stack_info: bool = False) -> tuple[str, int, str, str | None]: ... def handle(self, record: LogRecord) -> None: ... def makeRecord( @@ -350,7 +350,7 @@ class Formatter: self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = '%', validate: bool = True ) -> None: ... else: - def __init__(self, fmt: str | None = ..., datefmt: str | None = ..., style: _FormatStyle = ...) -> None: ... + def __init__(self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = '%') -> None: ... def format(self, record: LogRecord) -> str: ... def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: ... @@ -559,7 +559,7 @@ class LoggerAdapter(Generic[_L]): self, msg: object, *args: object, - exc_info: _ExcInfoType = ..., + exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ..., **kwargs: object, @@ -693,7 +693,7 @@ else: msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... ) -> None: ... def exception( - msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, *args: object, exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ... ) -> None: ... def log( level: int, diff --git a/stdlib/mimetypes.pyi b/stdlib/mimetypes.pyi index e39737e05452..fd3908680009 100644 --- a/stdlib/mimetypes.pyi +++ b/stdlib/mimetypes.pyi @@ -23,7 +23,7 @@ if sys.version_info >= (3, 8): def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(url: str, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... def guess_extension(type: str, strict: bool = True) -> str | None: ... @@ -48,7 +48,7 @@ class MimeTypes: if sys.version_info >= (3, 8): def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... else: - def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ... + def guess_type(self, url: str, strict: bool = True) -> tuple[str | None, str | None]: ... def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ... def read(self, filename: str, strict: bool = True) -> None: ... diff --git a/stdlib/modulefinder.pyi b/stdlib/modulefinder.pyi index 601d374ed35a..6e12e5ef8ce2 100644 --- a/stdlib/modulefinder.pyi +++ b/stdlib/modulefinder.pyi @@ -43,8 +43,8 @@ class ModuleFinder: else: def __init__( self, - path: list[str] | None = ..., - debug: int = ..., + path: list[str] | None = None, + debug: int = 0, excludes: Container[str] = ..., replace_paths: Sequence[tuple[str, str]] = ..., ) -> None: ... diff --git a/stdlib/multiprocessing/reduction.pyi b/stdlib/multiprocessing/reduction.pyi index 49648e4490ee..e5a8cde8f849 100644 --- a/stdlib/multiprocessing/reduction.pyi +++ b/stdlib/multiprocessing/reduction.pyi @@ -37,7 +37,7 @@ if sys.platform == "win32": handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None ) -> int: ... else: - def duplicate(handle: int, target_process: int | None = ..., inheritable: bool = ...) -> int: ... + def duplicate(handle: int, target_process: int | None = None, inheritable: bool = False) -> int: ... def steal_handle(source_pid: int, handle: int) -> int: ... def send_handle(conn: connection.PipeConnection, handle: int, destination_pid: int) -> None: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 672c7794730e..05535ae88103 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -758,11 +758,11 @@ def truncate(path: FileDescriptorOrPath, length: int) -> None: ... # Unix only def unlink(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... def utime( path: FileDescriptorOrPath, - times: tuple[int, int] | tuple[float, float] | None = ..., + times: tuple[int, int] | tuple[float, float] | None = None, *, - ns: tuple[int, int] = ..., - dir_fd: int | None = ..., - follow_symlinks: bool = ..., + ns: tuple[int, int] = None, + dir_fd: int | None = None, + follow_symlinks: bool = True, ) -> None: ... _OnError: TypeAlias = Callable[[OSError], object] @@ -886,7 +886,7 @@ def times() -> times_result: ... def waitpid(__pid: int, __options: int) -> tuple[int, int]: ... if sys.platform == "win32": - def startfile(path: StrOrBytesPath, operation: str | None = ...) -> None: ... + def startfile(path: StrOrBytesPath, operation: str | None = None) -> None: ... else: def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... diff --git a/stdlib/pickle.pyi b/stdlib/pickle.pyi index 7ebab5a24d1f..1b9aaf0b6ed1 100644 --- a/stdlib/pickle.pyi +++ b/stdlib/pickle.pyi @@ -133,10 +133,10 @@ if sys.version_info >= (3, 8): ) -> Any: ... else: - def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = ..., *, fix_imports: bool = ...) -> None: ... - def dumps(obj: Any, protocol: int | None = ..., *, fix_imports: bool = ...) -> bytes: ... - def load(file: _ReadableFileobj, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... - def loads(data: ReadableBuffer, *, fix_imports: bool = ..., encoding: str = ..., errors: str = ...) -> Any: ... + def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None, *, fix_imports: bool = True) -> None: ... + def dumps(obj: Any, protocol: int | None = None, *, fix_imports: bool = True) -> bytes: ... + def load(file: _ReadableFileobj, *, fix_imports: bool = True, encoding: str = 'ASCII', errors: str = 'strict') -> Any: ... + def loads(data: ReadableBuffer, *, fix_imports: bool = True, encoding: str = 'ASCII', errors: str = 'strict') -> Any: ... class PickleError(Exception): ... class PicklingError(PickleError): ... diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index 2bc52909e7e5..f8badefd8749 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -10,18 +10,18 @@ if sys.version_info >= (3, 8): def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... else: - def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> tuple[str, str]: ... + def libc_ver(executable: str = 'C:\\Users\\alexw\\.conda\\envs\\py37\\python.exe', lib: str = '', version: str = '', chunksize: int = 16384) -> tuple[str, str]: ... if sys.version_info < (3, 8): def linux_distribution( - distname: str = ..., - version: str = ..., - id: str = ..., + distname: str = '', + version: str = '', + id: str = '', supported_dists: tuple[str, ...] = ..., full_distribution_name: bool = ..., ) -> tuple[str, str, str]: ... def dist( - distname: str = ..., version: str = ..., id: str = ..., supported_dists: tuple[str, ...] = ... + distname: str = '', version: str = '', id: str = '', supported_dists: tuple[str, ...] = ... ) -> tuple[str, str, str]: ... def win32_ver(release: str = "", version: str = "", csd: str = "", ptype: str = "") -> tuple[str, str, str, str]: ... diff --git a/stdlib/pprint.pyi b/stdlib/pprint.pyi index 3f49857a9999..5a909c69b077 100644 --- a/stdlib/pprint.pyi +++ b/stdlib/pprint.pyi @@ -30,7 +30,7 @@ elif sys.version_info >= (3, 8): ) -> str: ... else: - def pformat(object: object, indent: int = ..., width: int = ..., depth: int | None = ..., *, compact: bool = ...) -> str: ... + def pformat(object: object, indent: int = 1, width: int = 80, depth: int | None = None, *, compact: bool = False) -> str: ... if sys.version_info >= (3, 10): def pp( @@ -85,12 +85,12 @@ elif sys.version_info >= (3, 8): else: def pprint( object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., + stream: IO[str] | None = None, + indent: int = 1, + width: int = 80, + depth: int | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def isreadable(object: object) -> bool: ... @@ -124,12 +124,12 @@ class PrettyPrinter: else: def __init__( self, - indent: int = ..., - width: int = ..., - depth: int | None = ..., - stream: IO[str] | None = ..., + indent: int = 1, + width: int = 80, + depth: int | None = None, + stream: IO[str] | None = None, *, - compact: bool = ..., + compact: bool = False, ) -> None: ... def pformat(self, object: object) -> str: ... diff --git a/stdlib/py_compile.pyi b/stdlib/py_compile.pyi index c12b74328928..48f1d7dc3e70 100644 --- a/stdlib/py_compile.pyi +++ b/stdlib/py_compile.pyi @@ -32,11 +32,11 @@ if sys.version_info >= (3, 8): else: def compile( file: AnyStr, - cfile: AnyStr | None = ..., - dfile: AnyStr | None = ..., - doraise: bool = ..., - optimize: int = ..., - invalidation_mode: PycInvalidationMode | None = ..., + cfile: AnyStr | None = None, + dfile: AnyStr | None = None, + doraise: bool = False, + optimize: int = -1, + invalidation_mode: PycInvalidationMode | None = None, ) -> AnyStr | None: ... if sys.version_info >= (3, 10): diff --git a/stdlib/pyexpat/__init__.pyi b/stdlib/pyexpat/__init__.pyi index 7e635c58c933..c6cc7fe24cd7 100644 --- a/stdlib/pyexpat/__init__.pyi +++ b/stdlib/pyexpat/__init__.pyi @@ -76,5 +76,5 @@ def ErrorString(__code: int) -> str: ... # intern is undocumented def ParserCreate( - encoding: str | None = ..., namespace_separator: str | None = ..., intern: dict[str, Any] | None = ... + encoding: str | None = None, namespace_separator: str | None = None, intern: dict[str, Any] | None = None ) -> XMLParserType: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 1b4c092aa609..0c46da98b2aa 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -76,10 +76,10 @@ else: def copytree( src: StrPath, dst: StrPath, - symlinks: bool = ..., - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = ..., + symlinks: bool = False, + ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, copy_function: Callable[[str, str], object] = ..., - ignore_dangling_symlinks: bool = ..., + ignore_dangling_symlinks: bool = False, ) -> _PathReturn: ... _OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object] @@ -139,7 +139,7 @@ if sys.version_info >= (3, 8): def which(cmd: bytes, mode: int = 1, path: StrPath | None = None) -> bytes | None: ... else: - def which(cmd: _StrPathT, mode: int = ..., path: StrPath | None = ...) -> str | _StrPathT | None: ... + def which(cmd: _StrPathT, mode: int = 1, path: StrPath | None = None) -> str | _StrPathT | None: ... def make_archive( base_name: str, diff --git a/stdlib/sre_parse.pyi b/stdlib/sre_parse.pyi index e137e191c08d..56f10bb41d57 100644 --- a/stdlib/sre_parse.pyi +++ b/stdlib/sre_parse.pyi @@ -55,7 +55,7 @@ class SubPattern: def __init__(self, state: State, data: list[_CodeType] | None = None) -> None: ... else: pattern: Pattern - def __init__(self, pattern: Pattern, data: list[_CodeType] | None = ...) -> None: ... + def __init__(self, pattern: Pattern, data: list[_CodeType] | None = None) -> None: ... def dump(self, level: int = 0) -> None: ... def __len__(self) -> int: ... @@ -102,7 +102,7 @@ if sys.version_info >= (3, 8): def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ... else: - def parse(str: str, flags: int = ..., pattern: Pattern | None = ...) -> SubPattern: ... + def parse(str: str, flags: int = 0, pattern: Pattern | None = None) -> SubPattern: ... @overload def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... @overload diff --git a/stdlib/symtable.pyi b/stdlib/symtable.pyi index 84d3110f9342..304ae8bf8126 100644 --- a/stdlib/symtable.pyi +++ b/stdlib/symtable.pyi @@ -42,7 +42,7 @@ class Symbol: ) -> None: ... def is_nonlocal(self) -> bool: ... else: - def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = ...) -> None: ... + def __init__(self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = None) -> None: ... def get_name(self) -> str: ... def is_referenced(self) -> bool: ... diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 242afeffe823..20468cd10d88 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -78,35 +78,35 @@ else: @overload def NamedTemporaryFile( mode: _StrMode, - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: _BytesMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: AnyStr | None = ..., - prefix: AnyStr | None = ..., - dir: GenericPath[AnyStr] | None = ..., - delete: bool = ..., + mode: str = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: AnyStr | None = None, + prefix: AnyStr | None = None, + dir: GenericPath[AnyStr] | None = None, + delete: bool = True, ) -> _TemporaryFileWrapper[Any]: ... if sys.platform == "win32": @@ -280,38 +280,38 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): @overload def __init__( self: SpooledTemporaryFile[bytes], - max_size: int = ..., - mode: _BytesMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _BytesMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self: SpooledTemporaryFile[str], - max_size: int = ..., - mode: _StrMode = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: _StrMode = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... @overload def __init__( self, - max_size: int = ..., - mode: str = ..., - buffering: int = ..., - encoding: str | None = ..., - newline: str | None = ..., - suffix: str | None = ..., - prefix: str | None = ..., - dir: str | None = ..., + max_size: int = 0, + mode: str = 'w+b', + buffering: int = -1, + encoding: str | None = None, + newline: str | None = None, + suffix: str | None = None, + prefix: str | None = None, + dir: str | None = None, ) -> None: ... def rollover(self) -> None: ... diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 2172bd2343d6..bd477535f41f 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -1107,7 +1107,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): if sys.version_info >= (3, 8): def selection(self) -> tuple[str, ...]: ... else: - def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = ...) -> tuple[str, ...]: ... + def selection(self, selop: Incomplete | None = ..., items: Incomplete | None = None) -> tuple[str, ...]: ... def selection_set(self, items: str | list[str] | tuple[str, ...]) -> None: ... def selection_add(self, items: str | list[str] | tuple[str, ...]) -> None: ... diff --git a/stdlib/xml/etree/ElementTree.pyi b/stdlib/xml/etree/ElementTree.pyi index 0d2656f9f4f2..cfc8504dde9f 100644 --- a/stdlib/xml/etree/ElementTree.pyi +++ b/stdlib/xml/etree/ElementTree.pyi @@ -237,25 +237,25 @@ if sys.version_info >= (3, 8): else: @overload def tostring( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> bytes: ... @overload def tostring( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> str: ... @overload - def tostring(element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ...) -> Any: ... + def tostring(element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True) -> Any: ... @overload def tostringlist( - element: Element, encoding: None = ..., method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: None = None, method: str | None = None, *, short_empty_elements: bool = True ) -> list[bytes]: ... @overload def tostringlist( - element: Element, encoding: Literal["unicode"], method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: Literal["unicode"], method: str | None = None, *, short_empty_elements: bool = True ) -> list[str]: ... @overload def tostringlist( - element: Element, encoding: str, method: str | None = ..., *, short_empty_elements: bool = ... + element: Element, encoding: str, method: str | None = None, *, short_empty_elements: bool = True ) -> list[Any]: ... def dump(elem: Element) -> None: ... diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index bd4cf62a0d40..927bc2801276 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -244,7 +244,7 @@ class Transport: self, use_datetime: bool = False, use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ... ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ... + def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ... def request( self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False @@ -275,7 +275,7 @@ class SafeTransport(Transport): context: Any | None = None, ) -> None: ... else: - def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Any | None = ...) -> None: ... + def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False, *, context: Any | None = None) -> None: ... def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... @@ -306,14 +306,14 @@ class ServerProxy: def __init__( self, uri: str, - transport: Transport | None = ..., - encoding: str | None = ..., - verbose: bool = ..., - allow_none: bool = ..., - use_datetime: bool = ..., - use_builtin_types: bool = ..., + transport: Transport | None = None, + encoding: str | None = None, + verbose: bool = False, + allow_none: bool = False, + use_datetime: bool = False, + use_builtin_types: bool = False, *, - context: Any | None = ..., + context: Any | None = None, ) -> None: ... def __getattr__(self, name: str) -> _Method: ... diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index e9267dbc89cc..2cd422339075 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -144,10 +144,10 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = 'r', + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, ) -> None: ... def __enter__(self: Self) -> Self: ... @@ -219,7 +219,7 @@ class ZipInfo: ) -> Self: ... else: @classmethod - def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = ...) -> Self: ... + def from_file(cls: type[Self], filename: StrPath, arcname: StrPath | None = None) -> Self: ... def is_dir(self) -> bool: ... def FileHeader(self, zip64: bool | None = None) -> bytes: ... From 1599c20af7767d06d4cc059f534b4b54080b9d38 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 28 Jan 2023 23:59:10 +0000 Subject: [PATCH 05/13] py311 branches --- stdlib/asyncio/base_events.pyi | 90 ++++---- stdlib/asyncio/events.pyi | 90 ++++---- stdlib/builtins.pyi | 10 +- stdlib/dataclasses.pyi | 20 +- stdlib/enum.pyi | 10 +- stdlib/gettext.pyi | 24 +- stdlib/multiprocessing/managers.pyi | 2 +- stdlib/random.pyi | 4 +- stdlib/statistics.pyi | 2 +- stdlib/subprocess.pyi | 340 ++++++++++++++-------------- stdlib/types.pyi | 22 +- stdlib/urllib/parse.pyi | 2 +- stdlib/warnings.pyi | 26 +-- stdlib/zipfile.pyi | 22 +- 14 files changed, 332 insertions(+), 332 deletions(-) diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 82dcd814b542..7f1ab72c181e 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -117,39 +117,39 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload @@ -226,37 +226,37 @@ class BaseEventLoop(AbstractEventLoop): async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., - port: int = ..., + host: str | Sequence[str] | None = None, + port: int = None, *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., - sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... async def start_tls( self, diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 79075748c4ee..82f06a942549 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -209,40 +209,40 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., + host: str = None, + port: int = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., - sock: None = ..., - local_addr: tuple[str, int] | None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, + sock: None = None, + local_addr: tuple[str, int] | None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... @overload @abstractmethod async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, - ssl: _SSLContext = ..., - family: int = ..., - proto: int = ..., - flags: int = ..., + ssl: _SSLContext = None, + family: int = 0, + proto: int = 0, + flags: int = 0, sock: socket, - local_addr: None = ..., - server_hostname: str | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - happy_eyeballs_delay: float | None = ..., - interleave: int | None = ..., + local_addr: None = None, + server_hostname: str | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + happy_eyeballs_delay: float | None = None, + interleave: int | None = None, ) -> tuple[Transport, _ProtocolT]: ... elif sys.version_info >= (3, 8): @overload @@ -324,38 +324,38 @@ class AbstractEventLoop: async def create_server( self, protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = ..., - port: int = ..., + host: str | Sequence[str] | None = None, + port: int = None, *, family: int = ..., flags: int = ..., - sock: None = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: None = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @overload @abstractmethod async def create_server( self, protocol_factory: _ProtocolFactory, - host: None = ..., - port: None = ..., + host: None = None, + port: None = None, *, family: int = ..., flags: int = ..., - sock: socket = ..., - backlog: int = ..., - ssl: _SSLContext = ..., - reuse_address: bool | None = ..., - reuse_port: bool | None = ..., - ssl_handshake_timeout: float | None = ..., - ssl_shutdown_timeout: float | None = ..., - start_serving: bool = ..., + sock: socket = None, + backlog: int = 100, + ssl: _SSLContext = None, + reuse_address: bool | None = None, + reuse_port: bool | None = None, + ssl_handshake_timeout: float | None = None, + ssl_shutdown_timeout: float | None = None, + start_serving: bool = True, ) -> Server: ... @abstractmethod async def start_tls( diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index c46fa067d405..5cfd01ba0690 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1571,14 +1571,14 @@ class _SupportsWriteAndFlush(SupportsWrite[_T_contra], Protocol[_T_contra]): @overload def print( *values: object, - sep: str | None = ..., - end: str | None = ..., - file: SupportsWrite[str] | None = ..., - flush: Literal[False] = ..., + sep: str | None = ' ', + end: str | None = '\n', + file: SupportsWrite[str] | None = None, + flush: Literal[False] = False, ) -> None: ... @overload def print( - *values: object, sep: str | None = ..., end: str | None = ..., file: _SupportsWriteAndFlush[str] | None = ..., flush: bool + *values: object, sep: str | None = ' ', end: str | None = '\n', file: _SupportsWriteAndFlush[str] | None = None, flush: bool ) -> None: ... _E = TypeVar("_E", contravariant=True) diff --git a/stdlib/dataclasses.pyi b/stdlib/dataclasses.pyi index 32b12ebab535..1c78958caadd 100644 --- a/stdlib/dataclasses.pyi +++ b/stdlib/dataclasses.pyi @@ -74,16 +74,16 @@ if sys.version_info >= (3, 11): @overload def dataclass( *, - init: bool = ..., - repr: bool = ..., - eq: bool = ..., - order: bool = ..., - unsafe_hash: bool = ..., - frozen: bool = ..., - match_args: bool = ..., - kw_only: bool = ..., - slots: bool = ..., - weakref_slot: bool = ..., + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, + match_args: bool = True, + kw_only: bool = False, + slots: bool = False, + weakref_slot: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... elif sys.version_info >= (3, 10): diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index 6fe26bf3cf1c..182076731ab2 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -121,11 +121,11 @@ class EnumMeta(ABCMeta): value: str, names: _EnumNames, *, - module: str | None = ..., - qualname: str | None = ..., - type: type | None = ..., - start: int = ..., - boundary: FlagBoundary | None = ..., + module: str | None = None, + qualname: str | None = None, + type: type | None = None, + start: int = 1, + boundary: FlagBoundary | None = None, ) -> type[Enum]: ... else: @overload diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 85b673db306a..71efd4de184b 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -74,19 +74,19 @@ if sys.version_info >= (3, 11): @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: None = ..., - fallback: Literal[False] = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: None = None, + fallback: Literal[False] = False, ) -> GNUTranslations: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, *, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( @@ -94,15 +94,15 @@ if sys.version_info >= (3, 11): localedir: StrPath | None, languages: Iterable[str] | None, class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = ..., + fallback: Literal[False] = False, ) -> _NullTranslationsT: ... @overload def translation( domain: str, - localedir: StrPath | None = ..., - languages: Iterable[str] | None = ..., - class_: Callable[[io.BufferedReader], NullTranslations] | None = ..., - fallback: bool = ..., + localedir: StrPath | None = None, + languages: Iterable[str] | None = None, + class_: Callable[[io.BufferedReader], NullTranslations] | None = None, + fallback: bool = False, ) -> NullTranslations: ... def install(domain: str, localedir: StrPath | None = None, *, names: Container[str] | None = None) -> None: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index c29d49708b4c..15f7238ed05e 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -137,7 +137,7 @@ class BaseManager: serializer: str = "pickle", ctx: BaseContext | None = None, *, - shutdown_timeout: float = ..., + shutdown_timeout: float = 1.0, ) -> None: ... else: def __init__( diff --git a/stdlib/random.pyi b/stdlib/random.pyi index 10086efad0fe..4849878691f5 100644 --- a/stdlib/random.pyi +++ b/stdlib/random.pyi @@ -83,8 +83,8 @@ class Random(_random.Random): def expovariate(self, lambd: float) -> float: ... def gammavariate(self, alpha: float, beta: float) -> float: ... if sys.version_info >= (3, 11): - def gauss(self, mu: float = ..., sigma: float = ...) -> float: ... - def normalvariate(self, mu: float = ..., sigma: float = ...) -> float: ... + def gauss(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... + def normalvariate(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... else: def gauss(self, mu: float, sigma: float) -> float: ... def normalvariate(self, mu: float, sigma: float) -> float: ... diff --git a/stdlib/statistics.pyi b/stdlib/statistics.pyi index 7f635dd37678..00d9bf1e1455 100644 --- a/stdlib/statistics.pyi +++ b/stdlib/statistics.pyi @@ -58,7 +58,7 @@ def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichCompariso def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... if sys.version_info >= (3, 11): - def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = ...) -> float: ... + def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = 1.0) -> float: ... else: def median_grouped(data: Iterable[_NumberT], interval: _NumberT = 1) -> _NumberT | float: ... diff --git a/stdlib/subprocess.pyi b/stdlib/subprocess.pyi index c62c264269e4..35a7b7e34f6b 100644 --- a/stdlib/subprocess.pyi +++ b/stdlib/subprocess.pyi @@ -118,13 +118,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: Literal[True], - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -152,13 +152,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str, errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -186,13 +186,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str, - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -221,13 +221,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the *real* keyword only args start - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: str | None = ..., + input: str | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -255,13 +255,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: None = ..., errors: None = ..., - input: ReadableBuffer | None = ..., + input: ReadableBuffer | None = None, text: Literal[None, False] = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -289,13 +289,13 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - capture_output: bool = ..., - check: bool = ..., + capture_output: bool = False, + check: bool = False, encoding: str | None = ..., errors: str | None = ..., - input: _InputString | None = ..., + input: _InputString | None = None, text: bool | None = ..., - timeout: float | None = ..., + timeout: float | None = None, user: str | int | None = ..., group: str | int | None = ..., extra_groups: Iterable[str | int] | None = ..., @@ -1124,7 +1124,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1155,7 +1155,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str, errors: str | None = ..., @@ -1186,7 +1186,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str, @@ -1218,7 +1218,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., # where the real keyword only ones start - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1249,7 +1249,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: None = ..., errors: None = ..., @@ -1280,7 +1280,7 @@ if sys.version_info >= (3, 11): start_new_session: bool = ..., pass_fds: Collection[int] = ..., *, - timeout: float | None = ..., + timeout: float | None = None, input: _InputString | None = ..., encoding: str | None = ..., errors: str | None = ..., @@ -1855,188 +1855,188 @@ class Popen(Generic[AnyStr]): def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., + text: bool | None = None, encoding: str, - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., + text: bool | None = None, + encoding: str | None = None, errors: str, - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, *, universal_newlines: Literal[True], - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., # where the *real* keyword only args start - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[str], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, text: Literal[True], - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[bytes], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: Literal[False, None] = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: Literal[False, None] = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: Literal[None, False] = ..., - encoding: None = ..., - errors: None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: Literal[None, False] = None, + encoding: None = None, + errors: None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... @overload def __init__( self: Popen[Any], args: _CMD, - bufsize: int = ..., - executable: StrOrBytesPath | None = ..., - stdin: _FILE | None = ..., - stdout: _FILE | None = ..., - stderr: _FILE | None = ..., - preexec_fn: Callable[[], Any] | None = ..., - close_fds: bool = ..., - shell: bool = ..., - cwd: StrOrBytesPath | None = ..., - env: _ENV | None = ..., - universal_newlines: bool | None = ..., - startupinfo: Any | None = ..., - creationflags: int = ..., - restore_signals: bool = ..., - start_new_session: bool = ..., + bufsize: int = -1, + executable: StrOrBytesPath | None = None, + stdin: _FILE | None = None, + stdout: _FILE | None = None, + stderr: _FILE | None = None, + preexec_fn: Callable[[], Any] | None = None, + close_fds: bool = True, + shell: bool = False, + cwd: StrOrBytesPath | None = None, + env: _ENV | None = None, + universal_newlines: bool | None = None, + startupinfo: Any | None = None, + creationflags: int = 0, + restore_signals: bool = True, + start_new_session: bool = False, pass_fds: Collection[int] = ..., *, - text: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., - user: str | int | None = ..., - group: str | int | None = ..., - extra_groups: Iterable[str | int] | None = ..., - umask: int = ..., - pipesize: int = ..., - process_group: int | None = ..., + text: bool | None = None, + encoding: str | None = None, + errors: str | None = None, + user: str | int | None = None, + group: str | int | None = None, + extra_groups: Iterable[str | int] | None = None, + umask: int = -1, + pipesize: int = -1, + process_group: int | None = None, ) -> None: ... elif sys.version_info >= (3, 10): # pipesize is added in 3.10 diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 7ecf4211a7d1..aa2b0c3f24f8 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -248,17 +248,17 @@ class CodeType: co_stacksize: int = -1, co_flags: int = -1, co_firstlineno: int = -1, - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_qualname: str = ..., - co_linetable: bytes = ..., - co_exceptiontable: bytes = ..., + co_code: bytes = None, + co_consts: tuple[object, ...] = None, + co_names: tuple[str, ...] = None, + co_varnames: tuple[str, ...] = None, + co_freevars: tuple[str, ...] = None, + co_cellvars: tuple[str, ...] = None, + co_filename: str = None, + co_name: str = None, + co_qualname: str = None, + co_linetable: bytes = None, + co_exceptiontable: bytes = None, ) -> CodeType: ... elif sys.version_info >= (3, 10): def replace( diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 42b23335421f..61456ce8e469 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -176,7 +176,7 @@ def urlsplit(url: str, scheme: str | None = '', allow_fragments: bool = True) -> if sys.version_info >= (3, 11): @overload - def urlsplit(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = ...) -> SplitResultBytes: ... + def urlsplit(url: bytes | None, scheme: bytes | None = '', allow_fragments: bool = True) -> SplitResultBytes: ... else: @overload diff --git a/stdlib/warnings.pyi b/stdlib/warnings.pyi index a9ecff675009..6222eb65918a 100644 --- a/stdlib/warnings.pyi +++ b/stdlib/warnings.pyi @@ -65,34 +65,34 @@ class catch_warnings(Generic[_W]): def __init__( self: catch_warnings[None], *, - record: Literal[False] = ..., - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + record: Literal[False] = False, + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage]], *, record: Literal[True], - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... @overload def __init__( self: catch_warnings[list[WarningMessage] | None], *, record: bool, - module: ModuleType | None = ..., - action: _ActionKind | None = ..., + module: ModuleType | None = None, + action: _ActionKind | None = None, category: type[Warning] = ..., - lineno: int = ..., - append: bool = ..., + lineno: int = 0, + append: bool = False, ) -> None: ... else: @overload diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index 2cd422339075..6de62e6cd962 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -109,25 +109,25 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: Literal["r"] = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: Literal["r"] = 'r', + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., + strict_timestamps: bool = True, metadata_encoding: str | None, ) -> None: ... @overload def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = ..., - compression: int = ..., - allowZip64: bool = ..., - compresslevel: int | None = ..., + mode: _ZipFileMode = 'r', + compression: int = 0, + allowZip64: bool = True, + compresslevel: int | None = None, *, - strict_timestamps: bool = ..., - metadata_encoding: None = ..., + strict_timestamps: bool = True, + metadata_encoding: None = None, ) -> None: ... elif sys.version_info >= (3, 8): def __init__( From bd19a9240e01ac61fa1e003cca71c956b6c2c039 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 00:04:12 +0000 Subject: [PATCH 06/13] Fix flake8 complaints --- stdlib/asyncio/windows_events.pyi | 2 +- stdlib/lib2to3/pytree.pyi | 2 +- stdlib/pydoc.pyi | 2 +- stdlib/re.pyi | 30 +++++++++++++++--------------- stdlib/smtpd.pyi | 4 ++-- stdlib/xmlrpc/client.pyi | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/stdlib/asyncio/windows_events.pyi b/stdlib/asyncio/windows_events.pyi index ae4f3991ee91..8c554f0d0314 100644 --- a/stdlib/asyncio/windows_events.pyi +++ b/stdlib/asyncio/windows_events.pyi @@ -42,7 +42,7 @@ if sys.platform == "win32": ) -> list[PipeServer]: ... class IocpProactor: - def __init__(self, concurrency: int = 4294967295) -> None: ... + def __init__(self, concurrency: int = ...) -> None: ... def __del__(self) -> None: ... def set_loop(self, loop: events.AbstractEventLoop) -> None: ... def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ... diff --git a/stdlib/lib2to3/pytree.pyi b/stdlib/lib2to3/pytree.pyi index cb56d20f6c36..ff3ac1a4dc25 100644 --- a/stdlib/lib2to3/pytree.pyi +++ b/stdlib/lib2to3/pytree.pyi @@ -83,7 +83,7 @@ class NodePattern(BasePattern): class WildcardPattern(BasePattern): min: int max: int - def __init__(self, content: str | None = None, min: int = 0, max: int = 2147483647, name: str | None = None) -> None: ... + def __init__(self, content: str | None = None, min: int = 0, max: int = ..., name: str | None = None) -> None: ... class NegatedPattern(BasePattern): def __init__(self, content: str | None = None) -> None: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index 2634a267ccb4..0d3e3e3aef82 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -58,7 +58,7 @@ class Doc: def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ... @abstractmethod def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ... - def getdocloc(self, object: object, basedir: str = 'C:\\Users\\alexw\\AppData\\Local\\Programs\\Python\\Python310\\Lib') -> str | None: ... + def getdocloc(self, object: object, basedir: str = ...) -> str | None: ... class HTMLRepr(Repr): def escape(self, text: str) -> str: ... diff --git a/stdlib/re.pyi b/stdlib/re.pyi index 636b94bcaa57..59cd8c8e323f 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -115,23 +115,23 @@ class Pattern(Generic[AnyStr]): @property def pattern(self) -> AnyStr: ... @overload - def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... + def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] + def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def search(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... + def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... + def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] + def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def match(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... + def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload - def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Match[str] | None: ... + def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Match[bytes] | None: ... # type: ignore[misc] + def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[misc] @overload - def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Match[AnyStr] | None: ... + def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload def split(self: Pattern[str], string: str, maxsplit: int = 0) -> list[str | Any]: ... @overload @@ -140,17 +140,17 @@ class Pattern(Generic[AnyStr]): def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | Any]: ... # return type depends on the number of groups in the pattern @overload - def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> list[Any]: ... + def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> list[Any]: ... + def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... @overload - def findall(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> list[AnyStr]: ... + def findall(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> list[AnyStr]: ... @overload - def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[str]]: ... + def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ... @overload - def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[bytes]]: ... # type: ignore[misc] + def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[bytes]]: ... # type: ignore[misc] @overload - def finditer(self, string: AnyStr, pos: int = 0, endpos: int = 9223372036854775807) -> Iterator[Match[AnyStr]]: ... + def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ... @overload def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... @overload diff --git a/stdlib/smtpd.pyi b/stdlib/smtpd.pyi index 7392bd51627d..a83e827bfc76 100644 --- a/stdlib/smtpd.pyi +++ b/stdlib/smtpd.pyi @@ -41,7 +41,7 @@ class SMTPChannel(asynchat.async_chat): server: SMTPServer, conn: socket.socket, addr: Any, - data_size_limit: int = 33554432, + data_size_limit: int = ..., map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, @@ -71,7 +71,7 @@ class SMTPServer(asyncore.dispatcher): self, localaddr: _Address, remoteaddr: _Address, - data_size_limit: int = 33554432, + data_size_limit: int = ..., map: asyncore._MapType | None = None, enable_SMTPUTF8: bool = False, decode_data: bool = False, diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 927bc2801276..7a3b5767b4d1 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -212,7 +212,7 @@ def loads( data: str, use_datetime: bool = False, use_builtin_types: bool = False ) -> tuple[tuple[_Marshallable, ...], str | None]: ... def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented -def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented +def gzip_decode(data: ReadableBuffer, max_decode: int = ...) -> bytes: ... # undocumented class GzipDecodedResponse(gzip.GzipFile): # undocumented From b39305ee691e2789e5e6ba4e525b2e619f0d33b4 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 00:46:10 +0000 Subject: [PATCH 07/13] Fix mypy complaints --- stdlib/_bisect.pyi | 8 ++--- stdlib/_dummy_threading.pyi | 2 +- stdlib/asyncio/base_events.pyi | 20 ++++++------ stdlib/asyncio/events.pyi | 20 ++++++------ stdlib/builtins.pyi | 2 +- stdlib/collections/__init__.pyi | 4 +-- stdlib/configparser.pyi | 2 +- stdlib/distutils/filelist.pyi | 6 ++-- stdlib/email/message.pyi | 14 ++++---- stdlib/gettext.pyi | 2 +- stdlib/mailbox.pyi | 2 +- stdlib/os/__init__.pyi | 2 +- stdlib/ssl.pyi | 2 +- stdlib/statistics.pyi | 2 +- stdlib/tempfile.pyi | 4 +-- stdlib/types.pyi | 58 ++++++++++++++++----------------- stdlib/typing.pyi | 2 +- stdlib/urllib/parse.pyi | 8 ++--- stdlib/weakref.pyi | 4 +-- 19 files changed, 82 insertions(+), 82 deletions(-) diff --git a/stdlib/_bisect.pyi b/stdlib/_bisect.pyi index 1b41ddb1a793..d46cdedcf3af 100644 --- a/stdlib/_bisect.pyi +++ b/stdlib/_bisect.pyi @@ -17,7 +17,7 @@ if sys.version_info >= (3, 10): lo: int = 0, hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = None, + key: Callable[[_T], SupportsRichComparisonT] = ..., ) -> int: ... @overload def bisect_right( @@ -30,7 +30,7 @@ if sys.version_info >= (3, 10): lo: int = 0, hi: int | None = None, *, - key: Callable[[_T], SupportsRichComparisonT] = None, + key: Callable[[_T], SupportsRichComparisonT] = ..., ) -> int: ... @overload def insort_left( @@ -43,7 +43,7 @@ if sys.version_info >= (3, 10): ) -> None: ... @overload def insort_left( - a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = None + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = ... ) -> None: ... @overload def insort_right( @@ -56,7 +56,7 @@ if sys.version_info >= (3, 10): ) -> None: ... @overload def insort_right( - a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = None + a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] = ... ) -> None: ... else: diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi index d5a42018bb0d..3a6e998f76fb 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 = None) -> int: ... +def stack_size(size: int = ...) -> int: ... TIMEOUT_MAX: float diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 7f1ab72c181e..3b8f286710b9 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -117,8 +117,8 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -156,8 +156,8 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -193,8 +193,8 @@ class BaseEventLoop(AbstractEventLoop): async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -227,7 +227,7 @@ class BaseEventLoop(AbstractEventLoop): self, protocol_factory: _ProtocolFactory, host: str | Sequence[str] | None = None, - port: int = None, + port: int = ..., *, family: int = ..., flags: int = ..., @@ -249,7 +249,7 @@ class BaseEventLoop(AbstractEventLoop): *, family: int = ..., flags: int = ..., - sock: socket = None, + sock: socket = ..., backlog: int = 100, ssl: _SSLContext = None, reuse_address: bool | None = None, @@ -284,7 +284,7 @@ class BaseEventLoop(AbstractEventLoop): self, protocol_factory: _ProtocolFactory, host: str | Sequence[str] | None = None, - port: int = None, + port: int = ..., *, family: int = ..., flags: int = ..., @@ -305,7 +305,7 @@ class BaseEventLoop(AbstractEventLoop): *, family: int = ..., flags: int = ..., - sock: socket = None, + sock: socket = ..., backlog: int = 100, ssl: _SSLContext = None, reuse_address: bool | None = None, diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index 82f06a942549..b2292801ee0d 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -209,8 +209,8 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -250,8 +250,8 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -289,8 +289,8 @@ class AbstractEventLoop: async def create_connection( self, protocol_factory: Callable[[], _ProtocolT], - host: str = None, - port: int = None, + host: str = ..., + port: int = ..., *, ssl: _SSLContext = None, family: int = 0, @@ -325,7 +325,7 @@ class AbstractEventLoop: self, protocol_factory: _ProtocolFactory, host: str | Sequence[str] | None = None, - port: int = None, + port: int = ..., *, family: int = ..., flags: int = ..., @@ -348,7 +348,7 @@ class AbstractEventLoop: *, family: int = ..., flags: int = ..., - sock: socket = None, + sock: socket = ..., backlog: int = 100, ssl: _SSLContext = None, reuse_address: bool | None = None, @@ -388,7 +388,7 @@ class AbstractEventLoop: self, protocol_factory: _ProtocolFactory, host: str | Sequence[str] | None = None, - port: int = None, + port: int = ..., *, family: int = ..., flags: int = ..., @@ -410,7 +410,7 @@ class AbstractEventLoop: *, family: int = ..., flags: int = ..., - sock: socket = None, + sock: socket = ..., backlog: int = 100, ssl: _SSLContext = None, reuse_address: bool | None = None, diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 5cfd01ba0690..92218c8f577d 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1630,7 +1630,7 @@ if sys.version_info >= (3, 8): @overload def pow(base: _SupportsPow3NoneOnly[_E, _T_co], exp: _E, mod: None = None) -> _T_co: ... @overload - def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = None) -> _T_co: ... + def pow(base: _SupportsPow3[_E, _M, _T_co], exp: _E, mod: _M = ...) -> _T_co: ... @overload def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... @overload diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 6e3485d35483..a9b3467443ee 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -196,7 +196,7 @@ class UserString(Sequence[UserString]): def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... @staticmethod @overload - def maketrans(x: str, y: str, z: str = None) -> dict[int, int | None]: ... + def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ... def partition(self, sep: str) -> tuple[str, str, str]: ... if sys.version_info >= (3, 9): def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... @@ -409,7 +409,7 @@ class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]): def __contains__(self, key: object) -> bool: ... def __missing__(self, key: _KT) -> _VT: ... # undocumented def __bool__(self) -> bool: ... - def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index 0538704d5de9..2170694624fb 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -67,7 +67,7 @@ class RawConfigParser(_Parser): self, defaults: Mapping[str, str | None] | None = None, dict_type: type[Mapping[str, str]] = ..., - allow_no_value: Literal[True] = False, + allow_no_value: Literal[True] = ..., *, delimiters: Sequence[str] = ..., comment_prefixes: Sequence[str] = ..., diff --git a/stdlib/distutils/filelist.pyi b/stdlib/distutils/filelist.pyi index de1e4f4fb395..77be175b9afb 100644 --- a/stdlib/distutils/filelist.pyi +++ b/stdlib/distutils/filelist.pyi @@ -21,7 +21,7 @@ class FileList: self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> bool: ... + def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def include_pattern( self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 @@ -31,7 +31,7 @@ class FileList: self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 ) -> bool: ... @overload - def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> bool: ... + def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> bool: ... @overload def exclude_pattern( self, pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 @@ -44,7 +44,7 @@ def translate_pattern( pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[False, 0] = 0 ) -> Pattern[str]: ... @overload -def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = 0) -> Pattern[str]: ... +def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1] = ...) -> Pattern[str]: ... @overload def translate_pattern( pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: int = 0 diff --git a/stdlib/email/message.pyi b/stdlib/email/message.pyi index d79f5b6a70d9..8ea834c4cf93 100644 --- a/stdlib/email/message.pyi +++ b/stdlib/email/message.pyi @@ -38,8 +38,8 @@ class Message: def keys(self) -> list[str]: ... def values(self) -> list[_HeaderType]: ... def items(self) -> list[tuple[str, _HeaderType]]: ... - def get(self, name: str, failobj: _T = None) -> _HeaderType | _T: ... - def get_all(self, name: str, failobj: _T = None) -> list[_HeaderType] | _T: ... + def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ... + def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ... def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... def replace_header(self, _name: str, _value: _HeaderType) -> None: ... def get_content_type(self) -> str: ... @@ -47,18 +47,18 @@ class Message: def get_content_subtype(self) -> str: ... def get_default_type(self) -> str: ... def set_default_type(self, ctype: str) -> None: ... - def get_params(self, failobj: _T = None, header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... - def get_param(self, param: str, failobj: _T = None, header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ... + def get_params(self, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... + def get_param(self, param: str, failobj: _T = ..., header: str = "content-type", unquote: bool = True) -> _T | _ParamType: ... def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ... def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ... - def get_filename(self, failobj: _T = None) -> _T | str: ... - def get_boundary(self, failobj: _T = None) -> _T | str: ... + def get_filename(self, failobj: _T = ...) -> _T | str: ... + def get_boundary(self, failobj: _T = ...) -> _T | str: ... def set_boundary(self, boundary: str) -> None: ... @overload def get_content_charset(self) -> str | None: ... @overload def get_content_charset(self, failobj: _T) -> str | _T: ... - def get_charsets(self, failobj: _T = None) -> _T | list[str]: ... + def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ... def walk(self: Self) -> Generator[Self, None, None]: ... def get_content_disposition(self) -> str | None: ... def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy | None = None) -> str: ... diff --git a/stdlib/gettext.pyi b/stdlib/gettext.pyi index 71efd4de184b..c31a36f73ac5 100644 --- a/stdlib/gettext.pyi +++ b/stdlib/gettext.pyi @@ -63,7 +63,7 @@ def find( # type: ignore[misc] ) -> str | None: ... @overload def find( - domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[True] = False + domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[True] = ... ) -> list[str]: ... @overload def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... diff --git a/stdlib/mailbox.pyi b/stdlib/mailbox.pyi index 7af718d4191d..21e2b4f77144 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 = None) -> _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/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 05535ae88103..718cda536c22 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -760,7 +760,7 @@ def utime( path: FileDescriptorOrPath, times: tuple[int, int] | tuple[float, float] | None = None, *, - ns: tuple[int, int] = None, + ns: tuple[int, int] = ..., dir_fd: int | None = None, follow_symlinks: bool = True, ) -> None: ... diff --git a/stdlib/ssl.pyi b/stdlib/ssl.pyi index 164fd8545bd7..3b68d107246a 100644 --- a/stdlib/ssl.pyi +++ b/stdlib/ssl.pyi @@ -380,7 +380,7 @@ class SSLContext: post_handshake_auth: bool if sys.version_info >= (3, 10): security_level: int - def __new__(cls: type[Self], protocol: int = None, *args: Any, **kwargs: Any) -> Self: ... + def __new__(cls: type[Self], protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ... def cert_store_stats(self) -> dict[str, int]: ... def load_cert_chain( self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None diff --git a/stdlib/statistics.pyi b/stdlib/statistics.pyi index 00d9bf1e1455..5fa519edf858 100644 --- a/stdlib/statistics.pyi +++ b/stdlib/statistics.pyi @@ -61,7 +61,7 @@ if sys.version_info >= (3, 11): def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = 1.0) -> float: ... else: - def median_grouped(data: Iterable[_NumberT], interval: _NumberT = 1) -> _NumberT | float: ... + def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT | float: ... def mode(data: Iterable[_HashableT]) -> _HashableT: ... diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 20468cd10d88..0fa972aacc41 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -250,7 +250,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self: SpooledTemporaryFile[str], max_size: int = 0, - mode: _StrMode = 'w+b', + mode: _StrMode = ..., buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -293,7 +293,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self: SpooledTemporaryFile[str], max_size: int = 0, - mode: _StrMode = 'w+b', + mode: _StrMode = ..., buffering: int = -1, encoding: str | None = None, newline: str | None = None, diff --git a/stdlib/types.pyi b/stdlib/types.pyi index aa2b0c3f24f8..5fb24106685e 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -248,17 +248,17 @@ class CodeType: co_stacksize: int = -1, co_flags: int = -1, co_firstlineno: int = -1, - co_code: bytes = None, - co_consts: tuple[object, ...] = None, - co_names: tuple[str, ...] = None, - co_varnames: tuple[str, ...] = None, - co_freevars: tuple[str, ...] = None, - co_cellvars: tuple[str, ...] = None, - co_filename: str = None, - co_name: str = None, - co_qualname: str = None, - co_linetable: bytes = None, - co_exceptiontable: bytes = None, + co_code: bytes = ..., + co_consts: tuple[object, ...] = ..., + co_names: tuple[str, ...] = ..., + co_varnames: tuple[str, ...] = ..., + co_freevars: tuple[str, ...] = ..., + co_cellvars: tuple[str, ...] = ..., + co_filename: str = ..., + co_name: str = ..., + co_qualname: str = ..., + co_linetable: bytes = ..., + co_exceptiontable: bytes = ..., ) -> CodeType: ... elif sys.version_info >= (3, 10): def replace( @@ -271,15 +271,15 @@ class CodeType: co_stacksize: int = -1, co_flags: int = -1, co_firstlineno: int = -1, - co_code: bytes = None, - co_consts: tuple[object, ...] = None, - co_names: tuple[str, ...] = None, - co_varnames: tuple[str, ...] = None, - co_freevars: tuple[str, ...] = None, - co_cellvars: tuple[str, ...] = None, - co_filename: str = None, - co_name: str = None, - co_linetable: bytes = None, + co_code: bytes = ..., + co_consts: tuple[object, ...] = ..., + co_names: tuple[str, ...] = ..., + co_varnames: tuple[str, ...] = ..., + co_freevars: tuple[str, ...] = ..., + co_cellvars: tuple[str, ...] = ..., + co_filename: str = ..., + co_name: str = ..., + co_linetable: bytes = ..., ) -> CodeType: ... elif sys.version_info >= (3, 8): def replace( @@ -292,15 +292,15 @@ class CodeType: co_stacksize: int = -1, co_flags: int = -1, co_firstlineno: int = -1, - co_code: bytes = None, - co_consts: tuple[object, ...] = None, - co_names: tuple[str, ...] = None, - co_varnames: tuple[str, ...] = None, - co_freevars: tuple[str, ...] = None, - co_cellvars: tuple[str, ...] = None, - co_filename: str = None, - co_name: str = None, - co_lnotab: bytes = None, + co_code: bytes = ..., + co_consts: tuple[object, ...] = ..., + co_names: tuple[str, ...] = ..., + co_varnames: tuple[str, ...] = ..., + co_freevars: tuple[str, ...] = ..., + co_cellvars: tuple[str, ...] = ..., + co_filename: str = ..., + co_name: str = ..., + co_lnotab: bytes = ..., ) -> CodeType: ... @final diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index e6a1f6213383..62a91779ac81 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -467,7 +467,7 @@ class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]): @abstractmethod def __getitem__(self, index: slice) -> Sequence[_T_co]: ... # Mixin methods - def index(self, value: Any, start: int = 0, stop: int = None) -> int: ... + def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ... def count(self, value: Any) -> int: ... def __contains__(self, value: object) -> bool: ... def __iter__(self) -> Iterator[_T_co]: ... diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 61456ce8e469..5cd550dab3dd 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -159,7 +159,7 @@ _Q = TypeVar("_Q", bound=str | Iterable[int]) def urlencode( query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]], doseq: bool = False, - safe: _Q = '', + safe: _Q = ..., encoding: str | None = None, errors: str | None = None, quote_via: Callable[[AnyStr, _Q, str, str], str] = ..., @@ -169,19 +169,19 @@ def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> A def urlparse(url: str, scheme: str | None = '', allow_fragments: bool = True) -> ParseResult: ... @overload def urlparse( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = '', allow_fragments: bool = True + url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = True ) -> ParseResultBytes: ... @overload def urlsplit(url: str, scheme: str | None = '', allow_fragments: bool = True) -> SplitResult: ... if sys.version_info >= (3, 11): @overload - def urlsplit(url: bytes | None, scheme: bytes | None = '', allow_fragments: bool = True) -> SplitResultBytes: ... + def urlsplit(url: bytes | None, scheme: bytes | None = ..., allow_fragments: bool = True) -> SplitResultBytes: ... else: @overload def urlsplit( - url: bytes | bytearray | None, scheme: bytes | bytearray | None = '', allow_fragments: bool = True + url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = True ) -> SplitResultBytes: ... @overload diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index a1a079d1a159..94dcd7918cea 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -70,7 +70,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ... - def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload @@ -109,7 +109,7 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]): def values(self) -> Iterator[_VT]: ... # type: ignore[override] def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] def keyrefs(self) -> list[ref[_KT]]: ... - def setdefault(self, key: _KT, default: _VT = None) -> _VT: ... + def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ... @overload def pop(self, key: _KT) -> _VT: ... @overload From 4eafdc0fcc700861055a5597a89d6c414de8f29f Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 01:03:09 +0000 Subject: [PATCH 08/13] Fix stubtest errors --- stdlib/asyncio/locks.pyi | 8 ++++---- stdlib/asyncio/queues.pyi | 2 +- stdlib/builtins.pyi | 2 +- stdlib/codecs.pyi | 2 +- stdlib/distutils/log.pyi | 2 +- stdlib/shutil.pyi | 2 +- stdlib/tarfile.pyi | 2 +- stdlib/tkinter/__init__.pyi | 6 +++--- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/stdlib/asyncio/locks.pyi b/stdlib/asyncio/locks.pyi index 357dfbc2bd1c..3e348e8c35e0 100644 --- a/stdlib/asyncio/locks.pyi +++ b/stdlib/asyncio/locks.pyi @@ -48,7 +48,7 @@ class Lock(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -58,7 +58,7 @@ class Event: if sys.version_info >= (3, 11): def __init__(self) -> None: ... else: - def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... + def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... def is_set(self) -> bool: ... def set(self) -> None: ... @@ -69,7 +69,7 @@ class Condition(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, lock: Lock | None = None) -> None: ... else: - def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = None) -> None: ... + def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... @@ -85,7 +85,7 @@ class Semaphore(_ContextManagerMixin): if sys.version_info >= (3, 11): def __init__(self, value: int = 1) -> None: ... else: - def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = None) -> None: ... + def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = ...) -> None: ... def locked(self) -> bool: ... async def acquire(self) -> Literal[True]: ... diff --git a/stdlib/asyncio/queues.pyi b/stdlib/asyncio/queues.pyi index cdc6fa5aeb90..76273be7588c 100644 --- a/stdlib/asyncio/queues.pyi +++ b/stdlib/asyncio/queues.pyi @@ -16,7 +16,7 @@ class Queue(Generic[_T]): if sys.version_info >= (3, 11): def __init__(self, maxsize: int = 0) -> None: ... else: - def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = None) -> None: ... + def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = ...) -> None: ... def _init(self, maxsize: int) -> None: ... def _get(self) -> _T: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 92218c8f577d..f50b7799cd93 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -847,7 +847,7 @@ class memoryview(Sequence[int]): @overload def __setitem__(self, __i: SupportsIndex, __o: SupportsIndex) -> None: ... if sys.version_info >= (3, 8): - def tobytes(self, order: Literal["C", "F", "A"] | None = "C") -> bytes: ... + def tobytes(self, order: Literal["C", "F", "A"] | None = ...) -> bytes: ... else: def tobytes(self) -> bytes: ... diff --git a/stdlib/codecs.pyi b/stdlib/codecs.pyi index 7eaf6b5091d4..7f852906c2d5 100644 --- a/stdlib/codecs.pyi +++ b/stdlib/codecs.pyi @@ -128,7 +128,7 @@ def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... def getreader(encoding: str) -> _StreamReader: ... def getwriter(encoding: str) -> _StreamWriter: ... def open( - filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1 + filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = ... ) -> StreamReaderWriter: ... def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ... def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ... diff --git a/stdlib/distutils/log.pyi b/stdlib/distutils/log.pyi index 14ed8d8aefa8..549b569e7356 100644 --- a/stdlib/distutils/log.pyi +++ b/stdlib/distutils/log.pyi @@ -7,7 +7,7 @@ ERROR: int FATAL: int class Log: - def __init__(self, threshold: int = 3) -> None: ... + def __init__(self, threshold: int = ...) -> None: ... def log(self, level: int, msg: str, *args: Any) -> None: ... def debug(self, msg: str, *args: Any) -> None: ... def info(self, msg: str, *args: Any) -> None: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 0c46da98b2aa..81707c5ab9a0 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -47,7 +47,7 @@ class ExecError(OSError): ... class ReadError(OSError): ... class RegistryError(Exception): ... -def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = 0) -> None: ... +def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = ...) -> None: ... def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = True) -> _StrOrBytesPathT: ... def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 9d07640feefc..18a7b673efeb 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -354,7 +354,7 @@ class TarInfo: @linkpath.setter def linkpath(self, linkname: str) -> None: ... def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ... - def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... + def tobuf(self, format: int | None = ..., encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... def create_ustar_header( self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str ) -> bytes: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 7982d18f2317..95096ba71425 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -736,8 +736,8 @@ class Tk(Misc, Wm): screenName: str | None = None, baseName: str | None = None, className: str = 'Tk', - useTk: bool = True, - sync: bool = False, + useTk: bool = ..., + sync: bool = ..., use: str | None = None, ) -> None: ... @overload @@ -800,7 +800,7 @@ class Tk(Misc, Wm): def wantobjects(self, *args, **kwargs): ... def willdispatch(self): ... -def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = 'Tk', useTk: bool = False) -> Tk: ... +def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = 'Tk', useTk: bool = ...) -> Tk: ... _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) From 634d6b8da5cc6d675189bf6260d6fe564c070bed Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 01:03:26 +0000 Subject: [PATCH 09/13] blacken --- stdlib/_codecs.pyi | 18 +++++----- stdlib/argparse.pyi | 4 +-- stdlib/ast.pyi | 16 +++++---- stdlib/asyncio/tasks.pyi | 16 ++++++--- stdlib/builtins.pyi | 8 ++--- stdlib/bz2.pyi | 12 +++---- stdlib/configparser.pyi | 8 +++-- stdlib/csv.pyi | 4 +-- stdlib/ctypes/__init__.pyi | 7 +++- stdlib/dataclasses.pyi | 8 ++++- stdlib/difflib.pyi | 4 +-- stdlib/dis.pyi | 4 ++- stdlib/distutils/command/bdist_msi.pyi | 6 ++-- stdlib/fileinput.pyi | 48 +++++++++++++------------- stdlib/ftplib.pyi | 16 ++++----- stdlib/gzip.pyi | 2 +- stdlib/imaplib.pyi | 8 ++--- stdlib/importlib/abc.pyi | 2 +- stdlib/logging/__init__.pyi | 12 ++++--- stdlib/logging/handlers.pyi | 6 ++-- stdlib/lzma.pyi | 2 +- stdlib/msilib/__init__.pyi | 2 +- stdlib/multiprocessing/managers.pyi | 6 +++- stdlib/os/__init__.pyi | 2 +- stdlib/pathlib.pyi | 2 +- stdlib/pickle.pyi | 4 +-- stdlib/platform.pyi | 15 +++++--- stdlib/pydoc.pyi | 6 ++-- stdlib/shutil.pyi | 8 ++--- stdlib/smtplib.pyi | 6 +++- stdlib/socket.pyi | 2 +- stdlib/sysconfig.pyi | 4 +-- stdlib/tarfile.pyi | 4 +-- stdlib/tempfile.pyi | 21 ++++++----- stdlib/tkinter/__init__.pyi | 26 ++++++++------ stdlib/tkinter/filedialog.pyi | 8 ++--- stdlib/tkinter/simpledialog.pyi | 2 +- stdlib/tkinter/tix.pyi | 12 +++---- stdlib/turtle.pyi | 20 ++++++----- stdlib/unittest/mock.pyi | 7 +++- stdlib/urllib/parse.pyi | 14 ++++---- stdlib/xml/dom/minidom.pyi | 8 ++--- stdlib/xmlrpc/client.pyi | 4 ++- stdlib/zipfile.pyi | 8 ++--- 44 files changed, 232 insertions(+), 170 deletions(-) diff --git a/stdlib/_codecs.pyi b/stdlib/_codecs.pyi index f440547613a7..e1b158db812e 100644 --- a/stdlib/_codecs.pyi +++ b/stdlib/_codecs.pyi @@ -45,27 +45,29 @@ _BytesToBytesEncoding: TypeAlias = Literal[ _StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"] @overload -def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = 'strict') -> bytes: ... +def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... @overload -def encode(obj: str, encoding: _StrToStrEncoding, errors: str = 'strict') -> str: ... # type: ignore[misc] +def encode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # type: ignore[misc] @overload -def encode(obj: str, encoding: str = 'utf-8', errors: str = 'strict') -> bytes: ... +def encode(obj: str, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = 'strict') -> bytes: ... # type: ignore[misc] +def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... # type: ignore[misc] @overload -def decode(obj: str, encoding: _StrToStrEncoding, errors: str = 'strict') -> str: ... +def decode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # these are documented as text encodings but in practice they also accept str as input @overload def decode( - obj: str, encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], errors: str = 'strict' + obj: str, + encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], + errors: str = "strict", ) -> str: ... # hex is officially documented as a bytes to bytes encoding, but it appears to also work with str @overload -def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = 'strict') -> bytes: ... +def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = "strict") -> bytes: ... @overload -def decode(obj: ReadableBuffer, encoding: str = 'utf-8', errors: str = 'strict') -> str: ... +def decode(obj: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> str: ... def lookup(__encoding: str) -> codecs.CodecInfo: ... def charmap_build(__map: str) -> _CharMap: ... def ascii_decode(__data: ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ... diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index 8f2e9f5822fb..20d9dfa9d137 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -154,10 +154,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): epilog: str | None = None, parents: Sequence[ArgumentParser] = ..., formatter_class: _FormatterClass = ..., - prefix_chars: str = '-', + prefix_chars: str = "-", fromfile_prefix_chars: str | None = None, argument_default: Any = None, - conflict_handler: str = 'error', + conflict_handler: str = "error", add_help: bool = True, allow_abbrev: bool = True, ) -> None: ... diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index 3d9d3bfb60c1..ea899e150f97 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -174,8 +174,8 @@ if sys.version_info >= (3, 8): @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = '', - mode: Literal["exec"] = 'exec', + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", *, type_comments: bool = False, feature_version: None | int | tuple[int, int] = None, @@ -234,8 +234,8 @@ if sys.version_info >= (3, 8): @overload def parse( source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = '', - mode: str = 'exec', + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: str = "exec", *, type_comments: bool = False, feature_version: None | int | tuple[int, int] = None, @@ -244,7 +244,9 @@ if sys.version_info >= (3, 8): else: @overload def parse( - source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = '', mode: Literal["exec"] = 'exec' + source: str | ReadableBuffer, + filename: str | ReadableBuffer | os.PathLike[Any] = "", + mode: Literal["exec"] = "exec", ) -> Module: ... @overload def parse( @@ -259,7 +261,9 @@ else: @overload def parse(source: str | ReadableBuffer, *, mode: Literal["single"]) -> Interactive: ... @overload - def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = '', mode: str = 'exec') -> AST: ... + def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer | os.PathLike[Any] = "", mode: str = "exec" + ) -> AST: ... if sys.version_info >= (3, 9): def unparse(ast_obj: AST) -> str: ... diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index bc6502140bd8..0a44255a3ac8 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -243,10 +243,10 @@ if sys.version_info >= (3, 10): @overload async def sleep(delay: float, result: _T) -> _T: ... @overload - async def wait(fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = 'ALL_COMPLETED') -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] + async def wait(fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED") -> tuple[set[_FT], set[_FT]]: ... # type: ignore[misc] @overload async def wait( - fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' + fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... @@ -258,11 +258,19 @@ else: async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = None) -> _T: ... @overload async def wait( # type: ignore[misc] - fs: Iterable[_FT], *, loop: AbstractEventLoop | None = None, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' + fs: Iterable[_FT], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[_FT], set[_FT]]: ... @overload async def wait( - fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None, return_when: str = 'ALL_COMPLETED' + fs: Iterable[Awaitable[_T]], + *, + loop: AbstractEventLoop | None = None, + timeout: float | None = None, + return_when: str = "ALL_COMPLETED", ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = None) -> _T: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index f50b7799cd93..3cdd31591b16 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1481,7 +1481,7 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def open( file: FileDescriptorOrPath, - mode: OpenTextMode = 'r', + mode: OpenTextMode = "r", buffering: int = -1, encoding: str | None = None, errors: str | None = None, @@ -1571,14 +1571,14 @@ class _SupportsWriteAndFlush(SupportsWrite[_T_contra], Protocol[_T_contra]): @overload def print( *values: object, - sep: str | None = ' ', - end: str | None = '\n', + sep: str | None = " ", + end: str | None = "\n", file: SupportsWrite[str] | None = None, flush: Literal[False] = False, ) -> None: ... @overload def print( - *values: object, sep: str | None = ' ', end: str | None = '\n', file: _SupportsWriteAndFlush[str] | None = None, flush: bool + *values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool ) -> None: ... _E = TypeVar("_E", contravariant=True) diff --git a/stdlib/bz2.pyi b/stdlib/bz2.pyi index 489b3bdab159..8a7151d9e456 100644 --- a/stdlib/bz2.pyi +++ b/stdlib/bz2.pyi @@ -30,7 +30,7 @@ _WriteTextMode: TypeAlias = Literal["wt", "xt", "at"] @overload def open( filename: _ReadableFileobj, - mode: _ReadBinaryMode = 'rb', + mode: _ReadBinaryMode = "rb", compresslevel: int = 9, encoding: None = None, errors: None = None, @@ -66,7 +66,7 @@ def open( @overload def open( filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = 'rb', + mode: _ReadBinaryMode | _WriteBinaryMode = "rb", compresslevel: int = 9, encoding: None = None, errors: None = None, @@ -97,10 +97,10 @@ class BZ2File(BaseStream, IO[bytes]): @overload def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = 9) -> None: ... @overload - def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', *, compresslevel: int = 9) -> None: ... + def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", *, compresslevel: int = 9) -> None: ... @overload def __init__( - self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = 'r', *, compresslevel: int = 9 + self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = "r", *, compresslevel: int = 9 ) -> None: ... else: @overload @@ -109,13 +109,13 @@ class BZ2File(BaseStream, IO[bytes]): ) -> None: ... @overload def __init__( - self, filename: _ReadableFileobj, mode: _ReadBinaryMode = 'r', buffering: Any | None = None, compresslevel: int = 9 + self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", buffering: Any | None = None, compresslevel: int = 9 ) -> None: ... @overload def __init__( self, filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = 'r', + mode: _ReadBinaryMode | _WriteBinaryMode = "r", buffering: Any | None = None, compresslevel: int = 9, ) -> None: ... diff --git a/stdlib/configparser.pyi b/stdlib/configparser.pyi index 2170694624fb..1ab7977fae75 100644 --- a/stdlib/configparser.pyi +++ b/stdlib/configparser.pyi @@ -74,7 +74,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = 'DEFAULT', + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -90,7 +90,7 @@ class RawConfigParser(_Parser): inline_comment_prefixes: Sequence[str] | None = None, strict: bool = True, empty_lines_in_values: bool = True, - default_section: str = 'DEFAULT', + default_section: str = "DEFAULT", interpolation: Interpolation | None = ..., converters: _ConvertersMap = ..., ) -> None: ... @@ -145,7 +145,9 @@ class RawConfigParser(_Parser): @overload # type: ignore[override] def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None) -> str | Any: ... @overload - def get(self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T) -> str | _T | Any: ... + def get( + self, section: str, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T + ) -> str | _T | Any: ... @overload def items(self, *, raw: bool = False, vars: _Section | None = None) -> ItemsView[str, SectionProxy]: ... @overload diff --git a/stdlib/csv.pyi b/stdlib/csv.pyi index f6811b58376e..13b483b219d5 100644 --- a/stdlib/csv.pyi +++ b/stdlib/csv.pyi @@ -78,7 +78,7 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): fieldnames: Sequence[_T], restkey: str | None = None, restval: str | None = None, - dialect: _DialectLike = 'excel', + dialect: _DialectLike = "excel", *, delimiter: str = ..., quotechar: str | None = ..., @@ -96,7 +96,7 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T | Any, str | Any]]): fieldnames: Sequence[str] | None = None, restkey: str | None = None, restval: str | None = None, - dialect: _DialectLike = 'excel', + dialect: _DialectLike = "excel", *, delimiter: str = ..., quotechar: str | None = ..., diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index ad9bb0c063fa..7cf7b25115bb 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -33,7 +33,12 @@ class CDLL: ) -> None: ... else: def __init__( - self, name: str | None, mode: int = 0, handle: int | None = None, use_errno: bool = False, use_last_error: bool = False + self, + name: str | None, + mode: int = 0, + handle: int | None = None, + use_errno: bool = False, + use_last_error: bool = False, ) -> None: ... def __getattr__(self, name: str) -> _NamedFuncPointer: ... diff --git a/stdlib/dataclasses.pyi b/stdlib/dataclasses.pyi index 1c78958caadd..3b7327137ec5 100644 --- a/stdlib/dataclasses.pyi +++ b/stdlib/dataclasses.pyi @@ -104,7 +104,13 @@ elif sys.version_info >= (3, 10): else: @overload def dataclass( - *, init: bool = True, repr: bool = True, eq: bool = True, order: bool = False, unsafe_hash: bool = False, frozen: bool = False + *, + init: bool = True, + repr: bool = True, + eq: bool = True, + order: bool = False, + unsafe_hash: bool = False, + frozen: bool = False, ) -> Callable[[type[_T]], type[_T]]: ... # See https://github.com/python/mypy/issues/10750 diff --git a/stdlib/difflib.pyi b/stdlib/difflib.pyi index b91cac81ff7c..b8efcafa31b9 100644 --- a/stdlib/difflib.pyi +++ b/stdlib/difflib.pyi @@ -36,8 +36,8 @@ class SequenceMatcher(Generic[_T]): def __init__( self: SequenceMatcher[str], isjunk: Callable[[str], bool] | None = None, - a: Sequence[str] = '', - b: Sequence[str] = '', + a: Sequence[str] = "", + b: Sequence[str] = "", autojunk: bool = True, ) -> None: ... def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... diff --git a/stdlib/dis.pyi b/stdlib/dis.pyi index cd3553bca69a..ea837f09c806 100644 --- a/stdlib/dis.pyi +++ b/stdlib/dis.pyi @@ -86,7 +86,9 @@ class Bytecode: cls: type[Self], tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False ) -> Self: ... else: - def __init__(self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None) -> None: ... + def __init__( + self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None + ) -> None: ... @classmethod def from_traceback(cls: type[Self], tb: types.TracebackType) -> Self: ... diff --git a/stdlib/distutils/command/bdist_msi.pyi b/stdlib/distutils/command/bdist_msi.pyi index 99d63b3e18d1..fa98e86d592a 100644 --- a/stdlib/distutils/command/bdist_msi.pyi +++ b/stdlib/distutils/command/bdist_msi.pyi @@ -9,9 +9,9 @@ if sys.platform == "win32": class PyDialog(Dialog): def __init__(self, *args, **kw) -> None: ... def title(self, title) -> None: ... - def back(self, title, next, name: str = 'Back', active: int = 1): ... - def cancel(self, title, next, name: str = 'Cancel', active: int = 1): ... - def next(self, title, next, name: str = 'Next', active: int = 1): ... + def back(self, title, next, name: str = "Back", active: int = 1): ... + def cancel(self, title, next, name: str = "Cancel", active: int = 1): ... + def next(self, title, next, name: str = "Next", active: int = 1): ... def xbutton(self, name, title, next, xpos): ... class bdist_msi(Command): diff --git a/stdlib/fileinput.pyi b/stdlib/fileinput.pyi index 2fa85b57d0b7..17379e92ba5f 100644 --- a/stdlib/fileinput.pyi +++ b/stdlib/fileinput.pyi @@ -38,9 +38,9 @@ if sys.version_info >= (3, 10): def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, encoding: str | None = None, errors: str | None = None, @@ -49,7 +49,7 @@ if sys.version_info >= (3, 10): def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: Literal["rb"], openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, @@ -60,7 +60,7 @@ if sys.version_info >= (3, 10): def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: str, openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, @@ -74,16 +74,16 @@ elif sys.version_info >= (3, 8): def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... @overload def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: Literal["rb"], openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, @@ -92,7 +92,7 @@ elif sys.version_info >= (3, 8): def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: str, openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, @@ -103,9 +103,9 @@ else: def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> FileInput[str]: ... # Because mode isn't keyword-only here yet, we need two overloads each for @@ -114,7 +114,7 @@ else: def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, *, mode: Literal["rb"], @@ -133,7 +133,7 @@ else: def input( files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, *, mode: str, @@ -166,9 +166,9 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[str], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, encoding: str | None = None, errors: str | None = None, @@ -178,7 +178,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[bytes], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: Literal["rb"], openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, @@ -190,7 +190,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[Any], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: str, openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, @@ -205,9 +205,9 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[str], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... @overload @@ -215,7 +215,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[bytes], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: Literal["rb"], openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, @@ -225,7 +225,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[Any], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", *, mode: str, openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, @@ -237,9 +237,9 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[str], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, - mode: _TextMode = 'r', + mode: _TextMode = "r", openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, ) -> None: ... # Because mode isn't keyword-only here yet, we need two overloads each for @@ -249,7 +249,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[bytes], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, *, mode: Literal["rb"], @@ -270,7 +270,7 @@ class FileInput(Iterator[AnyStr], Generic[AnyStr]): self: FileInput[Any], files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, inplace: bool = False, - backup: str = '', + backup: str = "", bufsize: int = 0, *, mode: str, diff --git a/stdlib/ftplib.pyi b/stdlib/ftplib.pyi index 0aa70a43a8de..6c33f1409822 100644 --- a/stdlib/ftplib.pyi +++ b/stdlib/ftplib.pyi @@ -56,10 +56,10 @@ class FTP: else: def __init__( self, - host: str = '', - user: str = '', - passwd: str = '', - acct: str = '', + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", timeout: float = ..., source_address: tuple[str, int] | None = None, ) -> None: ... @@ -136,10 +136,10 @@ class FTP_TLS(FTP): else: def __init__( self, - host: str = '', - user: str = '', - passwd: str = '', - acct: str = '', + host: str = "", + user: str = "", + passwd: str = "", + acct: str = "", keyfile: str | None = None, certfile: str | None = None, context: SSLContext | None = None, diff --git a/stdlib/gzip.pyi b/stdlib/gzip.pyi index cacfce4ab128..36f91036fd7c 100644 --- a/stdlib/gzip.pyi +++ b/stdlib/gzip.pyi @@ -43,7 +43,7 @@ class _WritableFileobj(Protocol): @overload def open( filename: StrOrBytesPath | _ReadableFileobj, - mode: _ReadBinaryMode = 'rb', + mode: _ReadBinaryMode = "rb", compresslevel: int = 9, encoding: None = None, errors: None = None, diff --git a/stdlib/imaplib.pyi b/stdlib/imaplib.pyi index 4f187455e18f..8016d8bec5cd 100644 --- a/stdlib/imaplib.pyi +++ b/stdlib/imaplib.pyi @@ -44,8 +44,8 @@ class IMAP4: def __init__(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... def open(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... else: - def __init__(self, host: str = '', port: int = 143) -> None: ... - def open(self, host: str = '', port: int = 143) -> None: ... + def __init__(self, host: str = "", port: int = 143) -> None: ... + def open(self, host: str = "", port: int = 143) -> None: ... def __getattr__(self, attr: str) -> Any: ... host: str @@ -123,7 +123,7 @@ class IMAP4_SSL(IMAP4): else: def __init__( self, - host: str = '', + host: str = "", port: int = 993, keyfile: str | None = None, certfile: str | None = None, @@ -134,7 +134,7 @@ class IMAP4_SSL(IMAP4): if sys.version_info >= (3, 9): def open(self, host: str = "", port: int | None = 993, timeout: float | None = None) -> None: ... else: - def open(self, host: str = '', port: int | None = 993) -> None: ... + def open(self, host: str = "", port: int | None = 993) -> None: ... def ssl(self) -> SSLSocket: ... diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index 0cd360d9cc54..78b79267d06e 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -123,7 +123,7 @@ if sys.version_info >= (3, 9): @abstractmethod def open( self, - mode: OpenTextMode = 'r', + mode: OpenTextMode = "r", buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index a32328d21c71..231700653a32 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -347,10 +347,10 @@ class Formatter: ) -> None: ... elif sys.version_info >= (3, 8): def __init__( - self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = '%', validate: bool = True + self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%", validate: bool = True ) -> None: ... else: - def __init__(self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = '%') -> None: ... + def __init__(self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%") -> None: ... def format(self, record: LogRecord) -> str: ... def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: ... @@ -693,7 +693,11 @@ else: msg: object, *args: object, exc_info: _ExcInfoType = ..., stack_info: bool = ..., extra: Mapping[str, object] | None = ... ) -> None: ... def exception( - msg: object, *args: object, exc_info: _ExcInfoType = True, stack_info: bool = ..., extra: Mapping[str, object] | None = ... + msg: object, + *args: object, + exc_info: _ExcInfoType = True, + stack_info: bool = ..., + extra: Mapping[str, object] | None = ..., ) -> None: ... def log( level: int, @@ -789,7 +793,7 @@ class FileHandler(StreamHandler[TextIOWrapper]): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = 'a', encoding: str | None = None, delay: bool = False) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _open(self) -> TextIOWrapper: ... # undocumented diff --git a/stdlib/logging/handlers.pyi b/stdlib/logging/handlers.pyi index 52a6a3dfbede..7e0bfd705895 100644 --- a/stdlib/logging/handlers.pyi +++ b/stdlib/logging/handlers.pyi @@ -25,7 +25,7 @@ class WatchedFileHandler(FileHandler): self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None ) -> None: ... else: - def __init__(self, filename: StrPath, mode: str = 'a', encoding: str | None = None, delay: bool = False) -> None: ... + def __init__(self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False) -> None: ... def _statstream(self) -> None: ... # undocumented def reopenIfNeeded(self) -> None: ... @@ -61,7 +61,7 @@ class RotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - mode: str = 'a', + mode: str = "a", maxBytes: int = 0, backupCount: int = 0, encoding: str | None = None, @@ -98,7 +98,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler): def __init__( self, filename: StrPath, - when: str = 'h', + when: str = "h", interval: int = 1, backupCount: int = 0, encoding: str | None = None, diff --git a/stdlib/lzma.pyi b/stdlib/lzma.pyi index d32b5425898a..2feb28a8e743 100644 --- a/stdlib/lzma.pyi +++ b/stdlib/lzma.pyi @@ -126,7 +126,7 @@ class LZMAFile(io.BufferedIOBase, IO[bytes]): @overload def open( filename: _PathOrFile, - mode: Literal["r", "rb"] = 'rb', + mode: Literal["r", "rb"] = "rb", *, format: int | None = None, check: Literal[-1] = -1, diff --git a/stdlib/msilib/__init__.pyi b/stdlib/msilib/__init__.pyi index 8035bfefe4b3..039fa3582712 100644 --- a/stdlib/msilib/__init__.pyi +++ b/stdlib/msilib/__init__.pyi @@ -124,7 +124,7 @@ if sys.platform == "win32": dlg: Dialog name: str def __init__(self, dlg: Dialog, name: str) -> None: ... - def event(self, event: str, argument: str, condition: str = '1', ordering: int | None = None) -> None: ... + def event(self, event: str, argument: str, condition: str = "1", ordering: int | None = None) -> None: ... def mapping(self, event: str, attribute: str) -> None: ... def condition(self, action: str, condition: str) -> None: ... diff --git a/stdlib/multiprocessing/managers.pyi b/stdlib/multiprocessing/managers.pyi index 15f7238ed05e..1696714d187b 100644 --- a/stdlib/multiprocessing/managers.pyi +++ b/stdlib/multiprocessing/managers.pyi @@ -141,7 +141,11 @@ class BaseManager: ) -> None: ... else: def __init__( - self, address: Any | None = None, authkey: bytes | None = None, serializer: str = 'pickle', ctx: BaseContext | None = None + self, + address: Any | None = None, + authkey: bytes | None = None, + serializer: str = "pickle", + ctx: BaseContext | None = None, ) -> None: ... def get_server(self) -> Server: ... diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 718cda536c22..117a3917d0b1 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -516,7 +516,7 @@ _Opener: TypeAlias = Callable[[str, int], int] @overload def fdopen( fd: int, - mode: OpenTextMode = 'r', + mode: OpenTextMode = "r", buffering: int = -1, encoding: str | None = None, errors: str | None = ..., diff --git a/stdlib/pathlib.pyi b/stdlib/pathlib.pyi index 1cdc5e1e4a2e..dd9ecbc1ddd1 100644 --- a/stdlib/pathlib.pyi +++ b/stdlib/pathlib.pyi @@ -106,7 +106,7 @@ class Path(PurePath): @overload def open( self, - mode: OpenTextMode = 'r', + mode: OpenTextMode = "r", buffering: int = -1, encoding: str | None = None, errors: str | None = None, diff --git a/stdlib/pickle.pyi b/stdlib/pickle.pyi index 1b9aaf0b6ed1..dc098cae97b7 100644 --- a/stdlib/pickle.pyi +++ b/stdlib/pickle.pyi @@ -135,8 +135,8 @@ if sys.version_info >= (3, 8): else: def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None, *, fix_imports: bool = True) -> None: ... def dumps(obj: Any, protocol: int | None = None, *, fix_imports: bool = True) -> bytes: ... - def load(file: _ReadableFileobj, *, fix_imports: bool = True, encoding: str = 'ASCII', errors: str = 'strict') -> Any: ... - def loads(data: ReadableBuffer, *, fix_imports: bool = True, encoding: str = 'ASCII', errors: str = 'strict') -> Any: ... + def load(file: _ReadableFileobj, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... + def loads(data: ReadableBuffer, *, fix_imports: bool = True, encoding: str = "ASCII", errors: str = "strict") -> Any: ... class PickleError(Exception): ... class PicklingError(PickleError): ... diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index f8badefd8749..4a08d9f851e4 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -10,18 +10,23 @@ if sys.version_info >= (3, 8): def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... else: - def libc_ver(executable: str = 'C:\\Users\\alexw\\.conda\\envs\\py37\\python.exe', lib: str = '', version: str = '', chunksize: int = 16384) -> tuple[str, str]: ... + def libc_ver( + executable: str = "C:\\Users\\alexw\\.conda\\envs\\py37\\python.exe", + lib: str = "", + version: str = "", + chunksize: int = 16384, + ) -> tuple[str, str]: ... if sys.version_info < (3, 8): def linux_distribution( - distname: str = '', - version: str = '', - id: str = '', + distname: str = "", + version: str = "", + id: str = "", supported_dists: tuple[str, ...] = ..., full_distribution_name: bool = ..., ) -> tuple[str, str, str]: ... def dist( - distname: str = '', version: str = '', id: str = '', supported_dists: tuple[str, ...] = ... + distname: str = "", version: str = "", id: str = "", supported_dists: tuple[str, ...] = ... ) -> tuple[str, str, str]: ... def win32_ver(release: str = "", version: str = "", csd: str = "", ptype: str = "") -> tuple[str, str, str, str]: ... diff --git a/stdlib/pydoc.pyi b/stdlib/pydoc.pyi index 0d3e3e3aef82..9bcd8659fc8c 100644 --- a/stdlib/pydoc.pyi +++ b/stdlib/pydoc.pyi @@ -88,7 +88,7 @@ class HTMLDoc(Doc): ) -> str: ... def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ... else: - def heading(self, title: str, fgcol: str, bgcol: str, extras: str = '') -> str: ... + def heading(self, title: str, fgcol: str, bgcol: str, extras: str = "") -> str: ... def section( self, title: str, @@ -96,9 +96,9 @@ class HTMLDoc(Doc): bgcol: str, contents: str, width: int = 6, - prelude: str = '', + prelude: str = "", marginalia: str | None = None, - gap: str = ' ', + gap: str = " ", ) -> str: ... def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = 4) -> str: ... diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index 81707c5ab9a0..b0714690e8fd 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -155,11 +155,11 @@ def make_archive( def get_archive_formats() -> list[tuple[str, str]]: ... @overload def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = '' + name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = "" ) -> None: ... @overload def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = '' + name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_archive_format(name: str) -> None: ... def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... @@ -169,11 +169,11 @@ def register_unpack_format( extensions: list[str], function: Callable[..., object], extra_args: Sequence[tuple[str, Any]], - description: str = '', + description: str = "", ) -> None: ... @overload def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = '' + name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_unpack_format(name: str) -> None: ... def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... diff --git a/stdlib/smtplib.pyi b/stdlib/smtplib.pyi index 166674f42097..d0d674242bf8 100644 --- a/stdlib/smtplib.pyi +++ b/stdlib/smtplib.pyi @@ -178,5 +178,9 @@ class LMTP(SMTP): ) -> None: ... else: def __init__( - self, host: str = '', port: int = 2003, local_hostname: str | None = None, source_address: _SourceAddress | None = None + self, + host: str = "", + port: int = 2003, + local_hostname: str | None = None, + source_address: _SourceAddress | None = None, ) -> None: ... diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 08ffbe966b6d..dde2511ee281 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -716,7 +716,7 @@ class socket(_socket.socket): @overload def makefile( self, - mode: Literal["r", "w", "rw", "wr", ""] = 'r', + mode: Literal["r", "w", "rw", "wr", ""] = "r", buffering: int | None = None, *, encoding: str | None = None, diff --git a/stdlib/sysconfig.pyi b/stdlib/sysconfig.pyi index a2ad309aca7f..69bdad5e6687 100644 --- a/stdlib/sysconfig.pyi +++ b/stdlib/sysconfig.pyi @@ -28,8 +28,8 @@ if sys.version_info >= (3, 10): def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... def get_path_names() -> tuple[str, ...]: ... -def get_path(name: str, scheme: str = 'nt', vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... -def get_paths(scheme: str = 'nt', vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... +def get_path(name: str, scheme: str = "nt", vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... +def get_paths(scheme: str = "nt", vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... def get_python_version() -> str: ... def get_platform() -> str: ... diff --git a/stdlib/tarfile.pyi b/stdlib/tarfile.pyi index 18a7b673efeb..873a2b635b7e 100644 --- a/stdlib/tarfile.pyi +++ b/stdlib/tarfile.pyi @@ -186,7 +186,7 @@ class TarFile: def gzopen( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = 'r', + mode: Literal["r"] = "r", fileobj: _GzipReadableFileobj | None = None, compresslevel: int = 9, *, @@ -240,7 +240,7 @@ class TarFile: def bz2open( cls: type[Self], name: StrOrBytesPath | None, - mode: Literal["r"] = 'r', + mode: Literal["r"] = "r", fileobj: _Bz2ReadableFileobj | None = None, compresslevel: int = 9, *, diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index 0fa972aacc41..301ba4efd5ba 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -49,7 +49,7 @@ if sys.version_info >= (3, 8): ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = 'w+b', + mode: _BytesMode = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -62,7 +62,7 @@ if sys.version_info >= (3, 8): ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = 'w+b', + mode: str = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -88,7 +88,7 @@ else: ) -> _TemporaryFileWrapper[str]: ... @overload def NamedTemporaryFile( - mode: _BytesMode = 'w+b', + mode: _BytesMode = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -99,7 +99,7 @@ else: ) -> _TemporaryFileWrapper[bytes]: ... @overload def NamedTemporaryFile( - mode: str = 'w+b', + mode: str = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -236,7 +236,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self: SpooledTemporaryFile[bytes], max_size: int = 0, - mode: _BytesMode = 'w+b', + mode: _BytesMode = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -264,7 +264,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self, max_size: int = 0, - mode: str = 'w+b', + mode: str = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -281,7 +281,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self: SpooledTemporaryFile[bytes], max_size: int = 0, - mode: _BytesMode = 'w+b', + mode: _BytesMode = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -305,7 +305,7 @@ class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): def __init__( self, max_size: int = 0, - mode: str = 'w+b', + mode: str = "w+b", buffering: int = -1, encoding: str | None = None, newline: str | None = None, @@ -375,7 +375,10 @@ class TemporaryDirectory(Generic[AnyStr]): ) -> None: ... @overload def __init__( - self: TemporaryDirectory[bytes], suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None + self: TemporaryDirectory[bytes], + suffix: bytes | None = None, + prefix: bytes | None = None, + dir: BytesPath | None = None, ) -> None: ... def cleanup(self) -> None: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 95096ba71425..f4ffaa6b159f 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -328,12 +328,12 @@ class Misc: def tk_strictMotif(self, boolean: Incomplete | None = None): ... def tk_bisque(self) -> None: ... def tk_setPalette(self, *args, **kw) -> None: ... - def wait_variable(self, name: str | Variable = 'PY_VAR') -> None: ... + def wait_variable(self, name: str | Variable = "PY_VAR") -> None: ... waitvar = wait_variable def wait_window(self, window: Misc | None = None) -> None: ... def wait_visibility(self, window: Misc | None = None) -> None: ... - def setvar(self, name: str = 'PY_VAR', value: str = '1') -> None: ... - def getvar(self, name: str = 'PY_VAR'): ... + def setvar(self, name: str = "PY_VAR", value: str = "1") -> None: ... + def getvar(self, name: str = "PY_VAR"): ... def getint(self, s): ... def getdouble(self, s): ... def getboolean(self, s): ... @@ -735,7 +735,7 @@ class Tk(Misc, Wm): self, screenName: str | None = None, baseName: str | None = None, - className: str = 'Tk', + className: str = "Tk", useTk: bool = ..., sync: bool = ..., use: str | None = None, @@ -800,7 +800,7 @@ class Tk(Misc, Wm): def wantobjects(self, *args, **kwargs): ... def willdispatch(self): ... -def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = 'Tk', useTk: bool = ...) -> Tk: ... +def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = ...) -> Tk: ... _InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) _InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) @@ -1719,7 +1719,7 @@ class Canvas(Widget, XView, YView): itemconfig = itemconfigure def move(self, *args) -> None: ... if sys.version_info >= (3, 8): - def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = '', y: Literal[""] | float = '') -> None: ... + def moveto(self, tagOrId: str | _CanvasItemId, x: Literal[""] | float = "", y: Literal[""] | float = "") -> None: ... def postscript(self, cnf=..., **kw): ... # tkinter does: @@ -2279,7 +2279,7 @@ class Menu(Widget): @overload def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... config = configure - def tk_popup(self, x: int, y: int, entry: str | int = '') -> None: ... + def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ... def activate(self, index: str | int) -> None: ... def add(self, itemType, cnf=..., **kw): ... # docstring says "Internal function." def insert(self, index, itemType, cnf=..., **kw): ... # docstring says "Internal function." @@ -3167,8 +3167,12 @@ class Text(Widget, XView, YView): def tag_delete(self, __first_tag_name: str, *tagNames: str) -> None: ... # error if no tag names given def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ... def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ... - def tag_nextrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> tuple[str, str] | tuple[()]: ... - def tag_prevrange(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> tuple[str, str] | tuple[()]: ... + def tag_nextrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... + def tag_prevrange( + self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None + ) -> tuple[str, str] | tuple[()]: ... def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ... def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ... # tag_remove and tag_delete are different @@ -3253,8 +3257,8 @@ class PhotoImage(Image): def cget(self, option: str) -> str: ... def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0' def copy(self) -> PhotoImage: ... - def zoom(self, x: int, y: int | Literal[""] = '') -> PhotoImage: ... - def subsample(self, x: int, y: int | Literal[""] = '') -> PhotoImage: ... + def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... + def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... def get(self, x: int, y: int) -> tuple[int, int, int]: ... def put( self, diff --git a/stdlib/tkinter/filedialog.pyi b/stdlib/tkinter/filedialog.pyi index 40c870a74152..10b36e4d3c06 100644 --- a/stdlib/tkinter/filedialog.pyi +++ b/stdlib/tkinter/filedialog.pyi @@ -44,7 +44,7 @@ class FileDialog: self, master, title: Incomplete | None = None ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either how: Incomplete | None - def go(self, dir_or_file='.', pattern: str = '*', default: str = '', key: Incomplete | None = None): ... + def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key: Incomplete | None = None): ... def quit(self, how: Incomplete | None = None) -> None: ... def dirs_double_event(self, event) -> None: ... def dirs_select_event(self, event) -> None: ... @@ -116,7 +116,7 @@ def askdirectory( # TODO: If someone actually uses these, overload to have the actual return type of open(..., mode) def asksaveasfile( - mode: str = 'w', + mode: str = "w", *, confirmoverwrite: bool | None = ..., defaultextension: str | None = ..., @@ -128,7 +128,7 @@ def asksaveasfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfile( - mode: str = 'r', + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., @@ -139,7 +139,7 @@ def askopenfile( typevariable: StringVar | str | None = ..., ) -> IO[Incomplete] | None: ... def askopenfiles( - mode: str = 'r', + mode: str = "r", *, defaultextension: str | None = ..., filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., diff --git a/stdlib/tkinter/simpledialog.pyi b/stdlib/tkinter/simpledialog.pyi index 62eaf0f78175..2c57cce7371c 100644 --- a/stdlib/tkinter/simpledialog.pyi +++ b/stdlib/tkinter/simpledialog.pyi @@ -13,7 +13,7 @@ class SimpleDialog: def __init__( self, master: Misc | None, - text: str = '', + text: str = "", buttons: list[str] = ..., default: int | None = None, cancel: int | None = None, diff --git a/stdlib/tkinter/tix.pyi b/stdlib/tkinter/tix.pyi index 05bd3fe4f513..5dd6f040fab7 100644 --- a/stdlib/tkinter/tix.pyi +++ b/stdlib/tkinter/tix.pyi @@ -46,7 +46,7 @@ class tixCommand: def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ... class Tk(tkinter.Tk, tixCommand): - def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = 'Tix') -> None: ... + def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tix") -> None: ... class TixWidget(tkinter.Widget): def __init__( @@ -66,9 +66,7 @@ class TixWidget(tkinter.Widget): def image_delete(self, imgname: str) -> None: ... class TixSubWidget(TixWidget): - def __init__( - self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1 - ) -> None: ... + def __init__(self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1) -> None: ... class DisplayStyle: def __init__(self, itemtype: str, cnf: dict[str, Any] = ..., *, master: tkinter.Widget | None = None, **kw) -> None: ... @@ -225,9 +223,9 @@ class CheckList(TixWidget): def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def getselection(self, mode: str = 'on') -> tuple[str, ...]: ... + def getselection(self, mode: str = "on") -> tuple[str, ...]: ... def getstatus(self, entrypath: str) -> str: ... - def setstatus(self, entrypath: str, mode: str = 'on') -> None: ... + def setstatus(self, entrypath: str, mode: str = "on") -> None: ... class Tree(TixWidget): def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... @@ -235,7 +233,7 @@ class Tree(TixWidget): def close(self, entrypath: str) -> None: ... def getmode(self, entrypath: str) -> str: ... def open(self, entrypath: str) -> None: ... - def setmode(self, entrypath: str, mode: str = 'none') -> None: ... + def setmode(self, entrypath: str, mode: str = "none") -> None: ... class TList(TixWidget, tkinter.XView, tkinter.YView): def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = ..., **kw) -> None: ... diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index f7cfc9592245..1259ca6fb4cc 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -188,7 +188,7 @@ class Shape: def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ... class TurtleScreen(TurtleScreenBase): - def __init__(self, cv: Canvas, mode: str = 'standard', colormode: float = 1.0, delay: int = 10) -> None: ... + def __init__(self, cv: Canvas, mode: str = "standard", colormode: float = 1.0, delay: int = 10) -> None: ... def clear(self) -> None: ... @overload def mode(self, mode: None = None) -> str: ... @@ -246,7 +246,7 @@ class TNavigator: DEFAULT_MODE: str DEFAULT_ANGLEOFFSET: int DEFAULT_ANGLEORIENT: int - def __init__(self, mode: str = 'standard') -> None: ... + def __init__(self, mode: str = "standard") -> None: ... def reset(self) -> None: ... def degrees(self, fullcircle: float = 360.0) -> None: ... def radians(self) -> None: ... @@ -286,7 +286,7 @@ class TNavigator: seth = setheading class TPen: - def __init__(self, resizemode: str = 'noresize') -> None: ... + def __init__(self, resizemode: str = "noresize") -> None: ... @overload def resizemode(self, rmode: None = None) -> str: ... @overload @@ -356,7 +356,11 @@ class RawTurtle(TPen, TNavigator): screen: TurtleScreen screens: ClassVar[list[TurtleScreen]] def __init__( - self, canvas: Canvas | TurtleScreen | None = None, shape: str = 'classic', undobuffersize: int = 1000, visible: bool = True + self, + canvas: Canvas | TurtleScreen | None = None, + shape: str = "classic", + undobuffersize: int = 1000, + visible: bool = True, ) -> None: ... def reset(self) -> None: ... def setundobuffer(self, size: int | None) -> None: ... @@ -402,7 +406,7 @@ class RawTurtle(TPen, TNavigator): def begin_fill(self) -> None: ... def end_fill(self) -> None: ... def dot(self, size: int | None = None, *color: _Color) -> None: ... - def write(self, arg: object, move: bool = False, align: str = 'left', font: tuple[str, int, str] = ...) -> None: ... + def write(self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly(self) -> None: ... def end_poly(self) -> None: ... def get_poly(self) -> _PolygonCoords | None: ... @@ -430,12 +434,12 @@ class _Screen(TurtleScreen): def exitonclick(self) -> None: ... class Turtle(RawTurtle): - def __init__(self, shape: str = 'classic', undobuffersize: int = 1000, visible: bool = True) -> None: ... + def __init__(self, shape: str = "classic", undobuffersize: int = 1000, visible: bool = True) -> None: ... RawPen = RawTurtle Pen = Turtle -def write_docstringdict(filename: str = 'turtle_docstringdict') -> None: ... +def write_docstringdict(filename: str = "turtle_docstringdict") -> None: ... # Note: it's somewhat unfortunate that we have to copy the function signatures. # It would be nice if we could partially reduce the redundancy by doing something @@ -671,7 +675,7 @@ def filling() -> bool: ... def begin_fill() -> None: ... def end_fill() -> None: ... def dot(size: int | None = None, *color: _Color) -> None: ... -def write(arg: object, move: bool = False, align: str = 'left', font: tuple[str, int, str] = ...) -> None: ... +def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ...) -> None: ... def begin_poly() -> None: ... def end_poly() -> None: ... def get_poly() -> _PolygonCoords | None: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index a14e05912df8..54c79fd433d2 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -408,7 +408,12 @@ if sys.version_info >= (3, 10): else: def create_autospec( - spec: Any, spec_set: Any = False, instance: Any = False, _parent: Any | None = None, _name: Any | None = None, **kwargs: Any + spec: Any, + spec_set: Any = False, + instance: Any = False, + _parent: Any | None = None, + _name: Any | None = None, + **kwargs: Any, ) -> Any: ... class _SpecState: diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 5cd550dab3dd..17b6a9eb11ef 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -132,20 +132,20 @@ def parse_qsl( separator: str = "&", ) -> list[tuple[AnyStr, AnyStr]]: ... @overload -def quote(string: str, safe: str | Iterable[int] = '/', encoding: str | None = None, errors: str | None = None) -> str: ... +def quote(string: str, safe: str | Iterable[int] = "/", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote(string: bytes | bytearray, safe: str | Iterable[int] = '/') -> str: ... +def quote(string: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... @overload -def quote_plus(string: str, safe: str | Iterable[int] = '', encoding: str | None = None, errors: str | None = None) -> str: ... +def quote_plus(string: str, safe: str | Iterable[int] = "", encoding: str | None = None, errors: str | None = None) -> str: ... @overload -def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = '') -> str: ... +def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = "") -> str: ... if sys.version_info >= (3, 9): def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... else: - def unquote(string: str, encoding: str = 'utf-8', errors: str = 'replace') -> str: ... + def unquote(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ... def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... @@ -166,13 +166,13 @@ def urlencode( ) -> str: ... def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ... @overload -def urlparse(url: str, scheme: str | None = '', allow_fragments: bool = True) -> ParseResult: ... +def urlparse(url: str, scheme: str | None = "", allow_fragments: bool = True) -> ParseResult: ... @overload def urlparse( url: bytes | bytearray | None, scheme: bytes | bytearray | None = ..., allow_fragments: bool = True ) -> ParseResultBytes: ... @overload -def urlsplit(url: str, scheme: str | None = '', allow_fragments: bool = True) -> SplitResult: ... +def urlsplit(url: str, scheme: str | None = "", allow_fragments: bool = True) -> SplitResult: ... if sys.version_info >= (3, 11): @overload diff --git a/stdlib/xml/dom/minidom.pyi b/stdlib/xml/dom/minidom.pyi index cbe81cb01e73..d996f66984f9 100644 --- a/stdlib/xml/dom/minidom.pyi +++ b/stdlib/xml/dom/minidom.pyi @@ -30,7 +30,7 @@ class Node(xml.dom.Node): ): ... else: def toxml(self, encoding: str | None = None): ... - def toprettyxml(self, indent: str = '\t', newl: str = '\n', encoding: str | None = None): ... + def toprettyxml(self, indent: str = "\t", newl: str = "\n", encoding: str | None = None): ... def hasChildNodes(self) -> bool: ... def insertBefore(self, newChild, refChild): ... @@ -333,9 +333,9 @@ class Document(Node, DocumentLS): def writexml( self, writer: SupportsWrite[str], - indent: str = '', - addindent: str = '', - newl: str = '', + indent: str = "", + addindent: str = "", + newl: str = "", encoding: Incomplete | None = None, ) -> None: ... diff --git a/stdlib/xmlrpc/client.pyi b/stdlib/xmlrpc/client.pyi index 7a3b5767b4d1..81fc694a88b1 100644 --- a/stdlib/xmlrpc/client.pyi +++ b/stdlib/xmlrpc/client.pyi @@ -275,7 +275,9 @@ class SafeTransport(Transport): context: Any | None = None, ) -> None: ... else: - def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False, *, context: Any | None = None) -> None: ... + def __init__( + self, use_datetime: bool = False, use_builtin_types: bool = False, *, context: Any | None = None + ) -> None: ... def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index 6de62e6cd962..ccf9df417d56 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -109,7 +109,7 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: Literal["r"] = 'r', + mode: Literal["r"] = "r", compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -121,7 +121,7 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = 'r', + mode: _ZipFileMode = "r", compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -133,7 +133,7 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = 'r', + mode: _ZipFileMode = "r", compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, @@ -144,7 +144,7 @@ class ZipFile: def __init__( self, file: StrPath | IO[bytes], - mode: _ZipFileMode = 'r', + mode: _ZipFileMode = "r", compression: int = 0, allowZip64: bool = True, compresslevel: int | None = None, From ec4471febf5540e08e9221fdd68cb3a67a0afffd Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 01:24:04 +0000 Subject: [PATCH 10/13] Temporarily use mypy-master for stubtest-stdlib, to see the results in CI --- .github/workflows/stubtest_stdlib.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index 3d0dd4a0d3ce..0f69aa713ae3 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -44,6 +44,6 @@ jobs: cache: pip cache-dependency-path: requirements-tests.txt - name: Install dependencies - run: pip install $(grep mypy== requirements-tests.txt) + run: pip install git+https://github.com/python/mypy@81efd6eaa0f8300ec4bd29d6797b9e4476a06d7d - name: Run stubtest run: python tests/stubtest_stdlib.py From 8d6817b920cc381a2c707211da03612b7ad89c56 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 01:32:28 +0000 Subject: [PATCH 11/13] Fix more issues found by running mypy-master stubtest in CI --- stdlib/ctypes/__init__.pyi | 4 ++-- stdlib/locale.pyi | 4 ++-- stdlib/platform.pyi | 2 +- stdlib/socket.pyi | 2 +- stdlib/sysconfig.pyi | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stdlib/ctypes/__init__.pyi b/stdlib/ctypes/__init__.pyi index 7cf7b25115bb..f3ee2245ab6d 100644 --- a/stdlib/ctypes/__init__.pyi +++ b/stdlib/ctypes/__init__.pyi @@ -25,7 +25,7 @@ class CDLL: def __init__( self, name: str | None, - mode: int = 0, + mode: int = ..., handle: int | None = None, use_errno: bool = False, use_last_error: bool = False, @@ -35,7 +35,7 @@ class CDLL: def __init__( self, name: str | None, - mode: int = 0, + mode: int = ..., handle: int | None = None, use_errno: bool = False, use_last_error: bool = False, diff --git a/stdlib/locale.pyi b/stdlib/locale.pyi index 99b78b50adff..0b0dd9456e52 100644 --- a/stdlib/locale.pyi +++ b/stdlib/locale.pyi @@ -115,10 +115,10 @@ def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) def localeconv() -> Mapping[_str, int | _str | list[int]]: ... def nl_langinfo(__key: int) -> _str: ... def getdefaultlocale(envvars: tuple[_str, ...] = ...) -> tuple[_str | None, _str | None]: ... -def getlocale(category: int = 2) -> tuple[_str | None, _str | None]: ... +def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ... def getpreferredencoding(do_setlocale: bool = True) -> _str: ... def normalize(localename: _str) -> _str: ... -def resetlocale(category: int = 0) -> None: ... +def resetlocale(category: int = ...) -> None: ... def strcoll(__os1: _str, __os2: _str) -> int: ... def strxfrm(__string: _str) -> _str: ... def format(percent: _str, value: float | Decimal, grouping: bool = False, monetary: bool = False, *additional: Any) -> _str: ... diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index 4a08d9f851e4..f6eb0b2cf7b1 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -11,7 +11,7 @@ if sys.version_info >= (3, 8): else: def libc_ver( - executable: str = "C:\\Users\\alexw\\.conda\\envs\\py37\\python.exe", + executable: str = ..., lib: str = "", version: str = "", chunksize: int = 16384, diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index dde2511ee281..4481f398867c 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -748,7 +748,7 @@ if sys.platform == "win32": else: def socketpair( - family: int | AddressFamily | None = None, type: SocketType | int = 1, proto: int = 0 + family: int | AddressFamily | None = None, type: SocketType | int = ..., proto: int = 0 ) -> tuple[socket, socket]: ... class SocketIO(RawIOBase): diff --git a/stdlib/sysconfig.pyi b/stdlib/sysconfig.pyi index 69bdad5e6687..7e29cf1326d6 100644 --- a/stdlib/sysconfig.pyi +++ b/stdlib/sysconfig.pyi @@ -28,8 +28,8 @@ if sys.version_info >= (3, 10): def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... def get_path_names() -> tuple[str, ...]: ... -def get_path(name: str, scheme: str = "nt", vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... -def get_paths(scheme: str = "nt", vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... +def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... +def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... def get_python_version() -> str: ... def get_platform() -> str: ... From 21e69216df51570e5589ec8ec2ebdcbf25d72ba0 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 29 Jan 2023 01:32:39 +0000 Subject: [PATCH 12/13] Revert "Temporarily use mypy-master for stubtest-stdlib, to see the results in CI" This reverts commit ec4471febf5540e08e9221fdd68cb3a67a0afffd. --- .github/workflows/stubtest_stdlib.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index 0f69aa713ae3..3d0dd4a0d3ce 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -44,6 +44,6 @@ jobs: cache: pip cache-dependency-path: requirements-tests.txt - name: Install dependencies - run: pip install git+https://github.com/python/mypy@81efd6eaa0f8300ec4bd29d6797b9e4476a06d7d + run: pip install $(grep mypy== requirements-tests.txt) - name: Run stubtest run: python tests/stubtest_stdlib.py From 1f921df686fb99606fda3e672bcc6e8b11dd52e6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 29 Jan 2023 01:33:54 +0000 Subject: [PATCH 13/13] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/platform.pyi | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stdlib/platform.pyi b/stdlib/platform.pyi index f6eb0b2cf7b1..e65739624603 100644 --- a/stdlib/platform.pyi +++ b/stdlib/platform.pyi @@ -10,12 +10,7 @@ if sys.version_info >= (3, 8): def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... else: - def libc_ver( - executable: str = ..., - lib: str = "", - version: str = "", - chunksize: int = 16384, - ) -> tuple[str, str]: ... + def libc_ver(executable: str = ..., lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... if sys.version_info < (3, 8): def linux_distribution(