Use lowercase tuple where possible (#6170)

This commit is contained in:
Akuli
2021-10-15 00:18:19 +00:00
committed by GitHub
parent 5f386b0575
commit 994b69ef8f
242 changed files with 1212 additions and 1224 deletions

View File

@@ -16,51 +16,51 @@ def lookup_error(__name: str) -> _Handler: ...
def decode(obj: Any, encoding: str = ..., errors: str | None = ...) -> Any: ...
def encode(obj: Any, encoding: str = ..., errors: str | None = ...) -> Any: ...
def charmap_build(__map: str) -> _MapT: ...
def ascii_decode(__data: bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def ascii_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _MapT | None = ...) -> Tuple[str, int]: ...
def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _MapT | None = ...) -> Tuple[bytes, int]: ...
def escape_decode(__data: str | bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def latin_1_decode(__data: bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def latin_1_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def unicode_escape_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def ascii_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def ascii_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[str, int]: ...
def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _MapT | None = ...) -> tuple[bytes, int]: ...
def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
if sys.version_info < (3, 8):
def unicode_internal_decode(__obj: str | bytes, __errors: str | None = ...) -> Tuple[str, int]: ...
def unicode_internal_encode(__obj: str | bytes, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def unicode_internal_decode(__obj: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
def unicode_internal_encode(__obj: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_16_be_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_16_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_16_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_16_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_16_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
def utf_16_ex_decode(
__data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[str, int, int]: ...
def utf_16_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_16_le_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def utf_32_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_32_be_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def utf_32_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_32_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
) -> tuple[str, int, int]: ...
def utf_16_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_16_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_32_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_32_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_32_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_32_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
def utf_32_ex_decode(
__data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[str, int, int]: ...
def utf_32_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_32_le_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def utf_7_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_7_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def utf_8_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def utf_8_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
) -> tuple[str, int, int]: ...
def utf_32_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_32_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_7_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_7_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def utf_8_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def utf_8_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
if sys.platform == "win32":
def mbcs_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def mbcs_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def code_page_decode(__codepage: int, __data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def code_page_encode(__code_page: int, __str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def oem_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> Tuple[str, int]: ...
def oem_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def mbcs_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def mbcs_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def code_page_decode(__codepage: int, __data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def code_page_encode(__code_page: int, __str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def oem_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
def oem_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...

View File

@@ -1,10 +1,10 @@
from typing import Tuple
IMPORT_MAPPING: dict[str, str]
NAME_MAPPING: dict[Tuple[str, str], Tuple[str, str]]
NAME_MAPPING: dict[tuple[str, str], tuple[str, str]]
PYTHON2_EXCEPTIONS: Tuple[str, ...]
MULTIPROCESSING_EXCEPTIONS: Tuple[str, ...]
REVERSE_IMPORT_MAPPING: dict[str, str]
REVERSE_NAME_MAPPING: dict[Tuple[str, str], Tuple[str, str]]
REVERSE_NAME_MAPPING: dict[tuple[str, str], tuple[str, str]]
PYTHON3_OSERROR_EXCEPTIONS: Tuple[str, ...]
PYTHON3_IMPORTERROR_EXCEPTIONS: Tuple[str, ...]

View File

@@ -1,5 +1,5 @@
import sys
from typing import IO, Any, BinaryIO, NamedTuple, Tuple, Union, overload
from typing import IO, Any, BinaryIO, NamedTuple, Union, overload
_chtype = Union[str, bytes, int]
@@ -273,7 +273,7 @@ def baudrate() -> int: ...
def beep() -> None: ...
def can_change_color() -> bool: ...
def cbreak(__flag: bool = ...) -> None: ...
def color_content(__color_number: int) -> Tuple[int, int, int]: ...
def color_content(__color_number: int) -> tuple[int, int, int]: ...
# Changed in Python 3.8.8 and 3.9.2
if sys.version_info >= (3, 8):
@@ -293,8 +293,8 @@ def erasechar() -> bytes: ...
def filter() -> None: ...
def flash() -> None: ...
def flushinp() -> None: ...
def getmouse() -> Tuple[int, int, int, int, int]: ...
def getsyx() -> Tuple[int, int]: ...
def getmouse() -> tuple[int, int, int, int, int]: ...
def getsyx() -> tuple[int, int]: ...
def getwin(__file: BinaryIO) -> _CursesWindow: ...
def halfdelay(__tenths: int) -> None: ...
def has_colors() -> bool: ...
@@ -316,7 +316,7 @@ def killchar() -> bytes: ...
def longname() -> bytes: ...
def meta(__yes: bool) -> None: ...
def mouseinterval(__interval: int) -> None: ...
def mousemask(__newmask: int) -> Tuple[int, int]: ...
def mousemask(__newmask: int) -> tuple[int, int]: ...
def napms(__ms: int) -> int: ...
def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ...
def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ...
@@ -326,7 +326,7 @@ def noecho() -> None: ...
def nonl() -> None: ...
def noqiflush() -> None: ...
def noraw() -> None: ...
def pair_content(__pair_number: int) -> Tuple[int, int]: ...
def pair_content(__pair_number: int) -> tuple[int, int]: ...
def pair_number(__attr: int) -> int: ...
def putp(__string: bytes) -> None: ...
def qiflush(__flag: bool = ...) -> None: ...
@@ -427,8 +427,8 @@ class _CursesWindow:
def echochar(self, __ch: _chtype, __attr: int = ...) -> None: ...
def enclose(self, __y: int, __x: int) -> bool: ...
def erase(self) -> None: ...
def getbegyx(self) -> Tuple[int, int]: ...
def getbkgd(self) -> Tuple[int, int]: ...
def getbegyx(self) -> tuple[int, int]: ...
def getbkgd(self) -> tuple[int, int]: ...
@overload
def getch(self) -> int: ...
@overload
@@ -441,8 +441,8 @@ class _CursesWindow:
def getkey(self) -> str: ...
@overload
def getkey(self, y: int, x: int) -> str: ...
def getmaxyx(self) -> Tuple[int, int]: ...
def getparyx(self) -> Tuple[int, int]: ...
def getmaxyx(self) -> tuple[int, int]: ...
def getparyx(self) -> tuple[int, int]: ...
@overload
def getstr(self) -> _chtype: ...
@overload
@@ -451,7 +451,7 @@ class _CursesWindow:
def getstr(self, y: int, x: int) -> _chtype: ...
@overload
def getstr(self, y: int, x: int, n: int) -> _chtype: ...
def getyx(self) -> Tuple[int, int]: ...
def getyx(self) -> tuple[int, int]: ...
@overload
def hline(self, ch: _chtype, n: int) -> None: ...
@overload

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Tuple
from typing import Any, Callable
class make_encoder:
sort_keys: Any
@@ -32,7 +32,7 @@ class make_scanner:
strict: bool
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
def __init__(self, context: make_scanner) -> None: ...
def __call__(self, string: str, index: int) -> Tuple[Any, int]: ...
def __call__(self, string: str, index: int) -> tuple[Any, int]: ...
def encode_basestring_ascii(s: str) -> str: ...
def scanstring(string: str, end: int, strict: bool = ...) -> Tuple[str, int]: ...
def scanstring(string: str, end: int, strict: bool = ...) -> tuple[str, int]: ...

View File

@@ -1,8 +1,6 @@
from typing import Tuple
class ParserBase:
def __init__(self) -> None: ...
def error(self, message: str) -> None: ...
def reset(self) -> None: ...
def getpos(self) -> Tuple[int, int]: ...
def getpos(self) -> tuple[int, int]: ...
def unknown_decl(self, data: str) -> None: ...

View File

@@ -30,4 +30,4 @@ def customize_config_vars(_config_vars: dict[str, str]) -> dict[str, str]: ...
def customize_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ...
def get_platform_osx(
_config_vars: dict[str, str], osname: _T, release: _K, machine: _V
) -> Tuple[str | _T, str | _K, str | _V]: ...
) -> tuple[str | _T, str | _K, str | _V]: ...

View File

@@ -1,8 +1,8 @@
# NOTE: These are incomplete!
from typing import Callable, Sequence, Tuple
from typing import Callable, Sequence
def cloexec_pipe() -> Tuple[int, int]: ...
def cloexec_pipe() -> tuple[int, int]: ...
def fork_exec(
args: Sequence[str],
executable_list: Sequence[bytes],

View File

@@ -1,11 +1,11 @@
from typing import Any, Dict, Tuple
from typing import Any, Dict
from weakref import ReferenceType
localdict = Dict[Any, Any]
class _localimpl:
key: str
dicts: dict[int, Tuple[ReferenceType[Any], localdict]]
dicts: dict[int, tuple[ReferenceType[Any], localdict]]
def __init__(self) -> None: ...
def get_dict(self) -> localdict: ...
def create_dict(self) -> localdict: ...

View File

@@ -1,12 +1,12 @@
import sys
from tracemalloc import _FrameTupleT, _TraceTupleT
from typing import Sequence, Tuple
from typing import Sequence
def _get_object_traceback(__obj: object) -> Sequence[_FrameTupleT] | None: ...
def _get_traces() -> Sequence[_TraceTupleT]: ...
def clear_traces() -> None: ...
def get_traceback_limit() -> int: ...
def get_traced_memory() -> Tuple[int, int]: ...
def get_traced_memory() -> tuple[int, int]: ...
def get_tracemalloc_memory() -> int: ...
def is_tracing() -> bool: ...

View File

@@ -7,7 +7,7 @@ import ctypes
import mmap
import sys
from os import PathLike
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, Tuple, TypeVar, Union
from typing import AbstractSet, Any, Awaitable, Container, Iterable, Protocol, TypeVar, Union
from typing_extensions import Literal, final
_KT = TypeVar("_KT")
@@ -57,7 +57,7 @@ class SupportsTrunc(Protocol):
# stable
class SupportsItems(Protocol[_KT_co, _VT_co]):
def items(self) -> AbstractSet[Tuple[_KT_co, _VT_co]]: ...
def items(self) -> AbstractSet[tuple[_KT_co, _VT_co]]: ...
# stable
class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):

View File

@@ -3,12 +3,12 @@
# See the README.md file in this directory for more information.
from sys import _OptExcInfo
from typing import Any, Callable, Dict, Iterable, Protocol, Tuple
from typing import Any, Callable, Dict, Iterable, Protocol
# stable
class StartResponse(Protocol):
def __call__(
self, status: str, headers: list[Tuple[str, str]], exc_info: _OptExcInfo | None = ...
self, status: str, headers: list[tuple[str, str]], exc_info: _OptExcInfo | None = ...
) -> Callable[[bytes], Any]: ...
WSGIEnvironment = Dict[str, Any] # stable

View File

@@ -1,4 +1,4 @@
from typing import Any, Tuple, Type, overload
from typing import Any, Type, overload
_defaultaction: str
_onceregistry: dict[Any, Any]
@@ -15,7 +15,7 @@ def warn_explicit(
filename: str,
lineno: int,
module: str | None = ...,
registry: dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
registry: dict[str | tuple[str, Type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
source: Any | None = ...,
) -> None: ...
@@ -26,7 +26,7 @@ def warn_explicit(
filename: str,
lineno: int,
module: str | None = ...,
registry: dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
registry: dict[str | tuple[str, Type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
source: Any | None = ...,
) -> None: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, NoReturn, Sequence, Tuple, overload
from typing import Any, NoReturn, Sequence, overload
from typing_extensions import Literal
CREATE_NEW_CONSOLE: int
@@ -73,7 +73,7 @@ def CreateNamedPipe(
__default_timeout: int,
__security_attributes: int,
) -> int: ...
def CreatePipe(__pipe_attrs: Any, __size: int) -> Tuple[int, int]: ...
def CreatePipe(__pipe_attrs: Any, __size: int) -> tuple[int, int]: ...
def CreateProcess(
__application_name: str | None,
__command_line: str | None,
@@ -84,7 +84,7 @@ def CreateProcess(
__env_mapping: dict[str, str],
__current_directory: str | None,
__startup_info: Any,
) -> Tuple[int, int, int, int]: ...
) -> tuple[int, int, int, int]: ...
def DuplicateHandle(
__source_process_handle: int,
__source_handle: int,
@@ -106,13 +106,13 @@ def GetModuleFileName(__module_handle: int) -> str: ...
def GetStdHandle(__std_handle: int) -> int: ...
def GetVersion() -> int: ...
def OpenProcess(__desired_access: int, __inherit_handle: bool, __process_id: int) -> int: ...
def PeekNamedPipe(__handle: int, __size: int = ...) -> Tuple[int, int] | Tuple[bytes, int, int]: ...
def PeekNamedPipe(__handle: int, __size: int = ...) -> tuple[int, int] | tuple[bytes, int, int]: ...
@overload
def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ...
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] = ...) -> tuple[bytes, int]: ...
@overload
def ReadFile(handle: int, size: int, overlapped: int | bool) -> Tuple[Any, int]: ...
def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ...
def SetNamedPipeHandleState(
__named_pipe: int, __mode: int | None, __max_collection_count: int | None, __collect_data_timeout: int | None
) -> None: ...
@@ -121,14 +121,14 @@ def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __mil
def WaitForSingleObject(__handle: int, __milliseconds: int) -> int: ...
def WaitNamedPipe(__name: str, __timeout: int) -> None: ...
@overload
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ...
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
@overload
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> Tuple[int, int]: ...
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> tuple[int, int]: ...
@overload
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> Tuple[Any, int]: ...
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> tuple[Any, int]: ...
class Overlapped:
event: int
def GetOverlappedResult(self, __wait: bool) -> Tuple[int, int]: ...
def GetOverlappedResult(self, __wait: bool) -> tuple[int, int]: ...
def cancel(self) -> None: ...
def getbuffer(self) -> bytes | None: ...

View File

@@ -61,7 +61,7 @@ class Aifc_write:
def setcomptype(self, comptype: bytes, compname: bytes) -> None: ...
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def setparams(self, params: Tuple[int, int, int, int, bytes, bytes]) -> None: ...
def setparams(self, params: tuple[int, int, int, int, bytes, bytes]) -> None: ...
def getparams(self) -> _aifc_params: ...
def setmark(self, id: int, pos: int, name: bytes) -> None: ...
def getmark(self, id: int) -> _Marker: ...

View File

@@ -20,7 +20,7 @@ class ArgumentError(Exception):
# undocumented
class _AttributeHolder:
def _get_kwargs(self) -> list[Tuple[str, Any]]: ...
def _get_kwargs(self) -> list[tuple[str, Any]]: ...
def _get_args(self) -> list[Any]: ...
# undocumented
@@ -67,10 +67,10 @@ class _ActionsContainer:
def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: Type[Action] | None = ...) -> Type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[Tuple[str, Action]]], Any]: ...
def _get_handler(self) -> Callable[[Action, Iterable[tuple[str, Action]]], Any]: ...
def _check_conflict(self, action: Action) -> None: ...
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[str, Action]]) -> NoReturn: ...
def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[str, Action]]) -> None: ...
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ...
def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> None: ...
class _FormatterClass(Protocol):
def __call__(self, prog: str) -> HelpFormatter: ...
@@ -169,7 +169,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def format_help(self) -> str: ...
def parse_known_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, list[str]]: ...
) -> tuple[Namespace, list[str]]: ...
def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ...
def exit(self, status: int = ..., message: str | None = ...) -> NoReturn: ...
def error(self, message: str) -> NoReturn: ...
@@ -177,16 +177,16 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def parse_intermixed_args(self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...) -> Namespace: ...
def parse_known_intermixed_args(
self, args: Sequence[str] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, list[str]]: ...
) -> tuple[Namespace, list[str]]: ...
# undocumented
def _get_optional_actions(self) -> list[Action]: ...
def _get_positional_actions(self) -> list[Action]: ...
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> Tuple[Namespace, list[str]]: ...
def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ...
def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ...
def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ...
def _parse_optional(self, arg_string: str) -> Tuple[Action | None, str, str | None] | None: ...
def _get_option_tuples(self, option_string: str) -> list[Tuple[Action, str, str | None]]: ...
def _parse_optional(self, arg_string: str) -> tuple[Action | None, str, str | None] | None: ...
def _get_option_tuples(self, option_string: str) -> list[tuple[Action, str, str | None]]: ...
def _get_nargs_pattern(self, action: Action) -> str: ...
def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ...
def _get_value(self, action: Action, arg_string: str) -> Any: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
@@ -23,7 +23,7 @@ class array(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self, typecode: str, __initializer: bytes | Iterable[_T] = ...) -> None: ...
def append(self, __v: _T) -> None: ...
def buffer_info(self) -> Tuple[int, int]: ...
def buffer_info(self) -> tuple[int, int]: ...
def byteswap(self) -> None: ...
def count(self, __v: Any) -> int: ...
def extend(self, __bb: Iterable[_T]) -> None: ...

View File

@@ -89,8 +89,8 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
# Network I/O methods returning Futures.
async def getaddrinfo(
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
) -> list[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
async def getnameinfo(self, sockaddr: Tuple[str, int] | Tuple[str, int, int, int], flags: int = ...) -> Tuple[str, str]: ...
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...
if sys.version_info >= (3, 8):
@overload
async def create_connection(
@@ -104,7 +104,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
happy_eyeballs_delay: float | None = ...,
@@ -141,7 +141,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
) -> _TransProtPair: ...
@@ -174,7 +174,7 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
) -> _TransProtPair: ...
@overload
@@ -288,8 +288,8 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
async def create_datagram_endpoint(
self,
protocol_factory: _ProtocolFactory,
local_addr: Tuple[str, int] | None = ...,
remote_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
*,
family: int = ...,
proto: int = ...,
@@ -343,12 +343,12 @@ class BaseEventLoop(AbstractEventLoop, metaclass=ABCMeta):
async def sock_recv_into(self, sock: socket, buf: bytearray) -> int: ...
async def sock_sendall(self, sock: socket, data: bytes) -> None: ...
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ...
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
else:
def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ...
def sock_sendall(self, sock: socket, data: bytes) -> Future[None]: ...
def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ...
def sock_accept(self, sock: socket) -> Future[Tuple[socket, _RetAddress]]: ...
def sock_accept(self, sock: socket) -> Future[tuple[socket, _RetAddress]]: ...
# Signal handling.
def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ...
def remove_signal_handler(self, sig: int) -> bool: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Sequence, Tuple
from typing import Any, Callable, Sequence
from typing_extensions import Literal
if sys.version_info >= (3, 7):
@@ -14,7 +14,7 @@ _FINISHED: Literal["FINISHED"] # undocumented
def isfuture(obj: object) -> bool: ...
if sys.version_info >= (3, 7):
def _format_callbacks(cb: Sequence[Tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented
def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented
else:
def _format_callbacks(cb: Sequence[Callable[[futures.Future[Any]], None]]) -> str: ... # undocumented

View File

@@ -14,7 +14,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
_pid: int | None # undocumented
_returncode: int | None # undocumented
_exit_waiters: list[futures.Future[Any]] # undocumented
_pending_calls: Deque[Tuple[Callable[..., Any], Tuple[Any, ...]]] # undocumented
_pending_calls: Deque[tuple[Callable[..., Any], Tuple[Any, ...]]] # undocumented
_pipes: dict[int, _File] # undocumented
_finished: bool # undocumented
def __init__(

View File

@@ -120,9 +120,9 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
async def getaddrinfo(
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
) -> list[Tuple[AddressFamily, SocketKind, int, str, Tuple[str, int] | Tuple[str, int, int, int]]]: ...
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
@abstractmethod
async def getnameinfo(self, sockaddr: Tuple[str, int] | Tuple[str, int, int, int], flags: int = ...) -> Tuple[str, str]: ...
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...
if sys.version_info >= (3, 8):
@overload
@abstractmethod
@@ -137,7 +137,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
happy_eyeballs_delay: float | None = ...,
@@ -176,7 +176,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
ssl_handshake_timeout: float | None = ...,
) -> _TransProtPair: ...
@@ -211,7 +211,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
proto: int = ...,
flags: int = ...,
sock: None = ...,
local_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
server_hostname: str | None = ...,
) -> _TransProtPair: ...
@overload
@@ -362,8 +362,8 @@ class AbstractEventLoop(metaclass=ABCMeta):
async def create_datagram_endpoint(
self,
protocol_factory: _ProtocolFactory,
local_addr: Tuple[str, int] | None = ...,
remote_addr: Tuple[str, int] | None = ...,
local_addr: tuple[str, int] | None = ...,
remote_addr: tuple[str, int] | None = ...,
*,
family: int = ...,
proto: int = ...,
@@ -430,7 +430,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
async def sock_connect(self, sock: socket, address: _Address) -> None: ...
@abstractmethod
async def sock_accept(self, sock: socket) -> Tuple[socket, _RetAddress]: ...
async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ...
else:
@abstractmethod
def sock_recv(self, sock: socket, nbytes: int) -> Future[bytes]: ...
@@ -439,7 +439,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
@abstractmethod
def sock_connect(self, sock: socket, address: _Address) -> Future[None]: ...
@abstractmethod
def sock_accept(self, sock: socket) -> Future[Tuple[socket, _RetAddress]]: ...
def sock_accept(self, sock: socket) -> Future[tuple[socket, _RetAddress]]: ...
# Signal handling.
@abstractmethod
def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: Any) -> None: ...

View File

@@ -2,7 +2,7 @@ import functools
import sys
import traceback
from types import FrameType, FunctionType
from typing import Any, Iterable, Tuple, Union, overload
from typing import Any, Iterable, Union, overload
class _HasWrapper:
__wrapper__: _HasWrapper | FunctionType
@@ -11,9 +11,9 @@ _FuncType = Union[FunctionType, _HasWrapper, functools.partial[Any], functools.p
if sys.version_info >= (3, 7):
@overload
def _get_function_source(func: _FuncType) -> Tuple[str, int]: ...
def _get_function_source(func: _FuncType) -> tuple[str, int]: ...
@overload
def _get_function_source(func: object) -> Tuple[str, int] | None: ...
def _get_function_source(func: object) -> tuple[str, int] | None: ...
def _format_callback_source(func: object, args: Iterable[Any]) -> str: ...
def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ...
def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = ...) -> str: ...

View File

@@ -1,6 +1,6 @@
import sys
from concurrent.futures._base import Error, Future as _ConcurrentFuture
from typing import Any, Awaitable, Callable, Generator, Iterable, Tuple, TypeVar
from typing import Any, Awaitable, Callable, Generator, Iterable, TypeVar
from .events import AbstractEventLoop
@@ -38,7 +38,7 @@ class Future(Awaitable[_T], Iterable[_T]):
def __del__(self) -> None: ...
if sys.version_info >= (3, 7):
def get_loop(self) -> AbstractEventLoop: ...
def _callbacks(self: _S) -> list[Tuple[Callable[[_S], Any], Context]]: ...
def _callbacks(self: _S) -> list[tuple[Callable[[_S], Any], Context]]: ...
def add_done_callback(self: _S, __fn: Callable[[_S], Any], *, context: Context | None = ...) -> None: ...
else:
@property

View File

@@ -1,6 +1,5 @@
import sys
from asyncio import transports
from typing import Tuple
class BaseProtocol:
def connection_made(self, transport: transports.BaseTransport) -> None: ...
@@ -19,7 +18,7 @@ if sys.version_info >= (3, 7):
class DatagramProtocol(BaseProtocol):
def connection_made(self, transport: transports.DatagramTransport) -> None: ... # type: ignore
def datagram_received(self, data: bytes, addr: Tuple[str, int]) -> None: ...
def datagram_received(self, data: bytes, addr: tuple[str, int]) -> None: ...
def error_received(self, exc: Exception) -> None: ...
class SubprocessProtocol(BaseProtocol):

View File

@@ -1,6 +1,6 @@
import ssl
import sys
from typing import Any, Callable, ClassVar, Deque, Tuple
from typing import Any, Callable, ClassVar, Deque
from typing_extensions import Literal
from . import constants, events, futures, protocols, transports
@@ -38,8 +38,8 @@ class _SSLPipe:
def do_handshake(self, callback: Callable[[BaseException | None], None] | None = ...) -> list[bytes]: ...
def shutdown(self, callback: Callable[[], 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 = ...) -> tuple[list[bytes], list[bytes]]: ...
def feed_appdata(self, data: bytes, offset: int = ...) -> tuple[list[bytes], int]: ...
class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
@@ -73,7 +73,7 @@ class SSLProtocol(protocols.Protocol):
_server_hostname: str | None
_sslcontext: ssl.SSLContext
_extra: dict[str, Any]
_write_backlog: Deque[Tuple[bytes, int]]
_write_backlog: Deque[tuple[bytes, int]]
_write_buffer_size: int
_waiter: futures.Future[Any]
_loop: events.AbstractEventLoop

View File

@@ -1,9 +1,9 @@
import sys
from typing import Any, Awaitable, Callable, Iterable, Tuple
from typing import Any, Awaitable, Callable, Iterable
from . import events
if sys.version_info >= (3, 8):
async def staggered_race(
coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = ...
) -> Tuple[Any, int | None, list[Exception | None]]: ...
) -> tuple[Any, int | None, list[Exception | None]]: ...

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import StrPath
from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Optional, Tuple
from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Optional
from . import events, protocols, transports
from .base_events import Server
@@ -24,7 +24,7 @@ async def open_connection(
limit: int = ...,
ssl_handshake_timeout: float | None = ...,
**kwds: Any,
) -> Tuple[StreamReader, StreamWriter]: ...
) -> tuple[StreamReader, StreamWriter]: ...
async def start_server(
client_connected_cb: _ClientConnectedCallback,
host: str | None = ...,
@@ -43,7 +43,7 @@ if sys.platform != "win32":
_PathType = str
async def open_unix_connection(
path: _PathType | None = ..., *, loop: events.AbstractEventLoop | None = ..., limit: int = ..., **kwds: Any
) -> Tuple[StreamReader, StreamWriter]: ...
) -> tuple[StreamReader, StreamWriter]: ...
async def start_unix_server(
client_connected_cb: _ClientConnectedCallback,
path: _PathType | None = ...,

View File

@@ -2,7 +2,7 @@ import subprocess
import sys
from _typeshed import StrOrBytesPath
from asyncio import events, protocols, streams, transports
from typing import IO, Any, Callable, Tuple, Union
from typing import IO, Any, Callable, Union
from typing_extensions import Literal
if sys.version_info >= (3, 8):
@@ -38,7 +38,7 @@ class Process:
def send_signal(self, signal: int) -> None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...
async def communicate(self, input: bytes | None = ...) -> Tuple[bytes, bytes]: ...
async def communicate(self, input: bytes | None = ...) -> tuple[bytes, bytes]: ...
if sys.version_info >= (3, 10):
async def create_subprocess_shell(

View File

@@ -2,7 +2,7 @@ import concurrent.futures
import sys
from collections.abc import Awaitable, Generator, Iterable, Iterator
from types import FrameType
from typing import Any, Generic, Optional, Set, TextIO, Tuple, TypeVar, Union, overload
from typing import Any, Generic, Optional, Set, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
from .events import AbstractEventLoop
@@ -47,11 +47,11 @@ def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | No
# typing PR #1550 for discussion.
if sys.version_info >= (3, 10):
@overload
def gather(coro_or_future1: _FutureT[_T1], *, return_exceptions: Literal[False] = ...) -> Future[Tuple[_T1]]: ...
def gather(coro_or_future1: _FutureT[_T1], *, return_exceptions: Literal[False] = ...) -> Future[tuple[_T1]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], *, return_exceptions: Literal[False] = ...
) -> Future[Tuple[_T1, _T2]]: ...
) -> Future[tuple[_T1, _T2]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -59,7 +59,7 @@ if sys.version_info >= (3, 10):
coro_or_future3: _FutureT[_T3],
*,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3]]: ...
) -> Future[tuple[_T1, _T2, _T3]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -68,7 +68,7 @@ if sys.version_info >= (3, 10):
coro_or_future4: _FutureT[_T4],
*,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -78,7 +78,7 @@ if sys.version_info >= (3, 10):
coro_or_future5: _FutureT[_T5],
*,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def gather(
coro_or_future1: _FutureT[Any],
@@ -91,11 +91,11 @@ if sys.version_info >= (3, 10):
return_exceptions: bool = ...,
) -> Future[list[Any]]: ...
@overload
def gather(coro_or_future1: _FutureT[_T1], *, return_exceptions: bool = ...) -> Future[Tuple[_T1 | BaseException]]: ...
def gather(coro_or_future1: _FutureT[_T1], *, return_exceptions: bool = ...) -> Future[tuple[_T1 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1], coro_or_future2: _FutureT[_T2], *, return_exceptions: bool = ...
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -103,7 +103,7 @@ if sys.version_info >= (3, 10):
coro_or_future3: _FutureT[_T3],
*,
return_exceptions: bool = ...,
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -112,7 +112,7 @@ if sys.version_info >= (3, 10):
coro_or_future4: _FutureT[_T4],
*,
return_exceptions: bool = ...,
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -123,14 +123,14 @@ if sys.version_info >= (3, 10):
*,
return_exceptions: bool = ...,
) -> Future[
Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
]: ...
else:
@overload
def gather(
coro_or_future1: _FutureT[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: Literal[False] = ...
) -> Future[Tuple[_T1]]: ...
) -> Future[tuple[_T1]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -138,7 +138,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2]]: ...
) -> Future[tuple[_T1, _T2]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -147,7 +147,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3]]: ...
) -> Future[tuple[_T1, _T2, _T3]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -157,7 +157,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -168,7 +168,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: Literal[False] = ...,
) -> Future[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def gather(
coro_or_future1: _FutureT[Any],
@@ -184,7 +184,7 @@ else:
@overload
def gather(
coro_or_future1: _FutureT[_T1], *, loop: AbstractEventLoop | None = ..., return_exceptions: bool = ...
) -> Future[Tuple[_T1 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -192,7 +192,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: bool = ...,
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -201,7 +201,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: bool = ...,
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -211,7 +211,7 @@ else:
*,
loop: AbstractEventLoop | None = ...,
return_exceptions: bool = ...,
) -> Future[Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
@overload
def gather(
coro_or_future1: _FutureT[_T1],
@@ -223,7 +223,7 @@ else:
loop: AbstractEventLoop | None = ...,
return_exceptions: bool = ...,
) -> Future[
Tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
]: ...
def run_coroutine_threadsafe(coro: _FutureT[_T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
@@ -232,22 +232,22 @@ if sys.version_info >= (3, 10):
def shield(arg: _FutureT[_T]) -> Future[_T]: ...
def sleep(delay: float, result: _T = ...) -> Future[_T]: ...
@overload
def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> Future[Tuple[Set[_FT], Set[_FT]]]: ... # type: ignore
def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> Future[tuple[Set[_FT], Set[_FT]]]: ... # type: ignore
@overload
def wait(
fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ...
) -> Future[Tuple[Set[Task[_T]], Set[Task[_T]]]]: ...
) -> Future[tuple[Set[Task[_T]], Set[Task[_T]]]]: ...
def wait_for(fut: _FutureT[_T], timeout: float | None) -> Future[_T]: ...
else:
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
def sleep(delay: float, result: _T = ..., *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
@overload
def wait(fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...) -> Future[Tuple[Set[_FT], Set[_FT]]]: ... # type: ignore
def wait(fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...) -> Future[tuple[Set[_FT], Set[_FT]]]: ... # type: ignore
@overload
def wait(
fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...
) -> Future[Tuple[Set[Task[_T]], Set[Task[_T]]]]: ...
) -> Future[tuple[Set[Task[_T]], Set[Task[_T]]]]: ...
def wait_for(fut: _FutureT[_T], timeout: float | None, *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
class Task(Future[_T], Generic[_T]):

View File

@@ -2,7 +2,7 @@ import sys
from asyncio.events import AbstractEventLoop
from asyncio.protocols import BaseProtocol
from socket import _Address
from typing import Any, Mapping, Tuple
from typing import Any, Mapping
class BaseTransport:
def __init__(self, extra: Mapping[Any, Any] | None = ...) -> None: ...
@@ -43,4 +43,4 @@ class SubprocessTransport(BaseTransport):
class _FlowControlMixin(Transport):
def __init__(self, extra: Mapping[Any, Any] | None = ..., loop: AbstractEventLoop | None = ...) -> None: ...
def get_write_buffer_limits(self) -> Tuple[int, int]: ...
def get_write_buffer_limits(self) -> tuple[int, int]: ...

View File

@@ -34,14 +34,14 @@ if sys.version_info >= (3, 8):
def getpeername(self) -> _RetAddress: ...
def getsockname(self) -> _RetAddress: ...
def getsockbyname(self) -> NoReturn: ... # This method doesn't exist on socket, yet is passed through?
def accept(self) -> Tuple[socket.socket, _RetAddress]: ...
def accept(self) -> tuple[socket.socket, _RetAddress]: ...
def connect(self, address: _Address | bytes) -> None: ...
def connect_ex(self, address: _Address | bytes) -> int: ...
def bind(self, address: _Address | bytes) -> None: ...
if sys.platform == "win32":
def ioctl(self, control: int, option: int | Tuple[int, int, int] | bool) -> None: ...
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ...
else:
def ioctl(self, control: int, option: int | Tuple[int, int, int] | bool) -> NoReturn: ...
def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ...
def listen(self, __backlog: int = ...) -> None: ...
def makefile(self) -> BinaryIO: ...
def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ...
@@ -70,12 +70,12 @@ if sys.version_info >= (3, 8):
else:
def share(self, process_id: int) -> NoReturn: ...
def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> Tuple[int, _RetAddress]: ...
def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
def recvmsg_into(
self, __buffers: Iterable[_WriteBuffer], __ancbufsize: int = ..., __flags: int = ...
) -> Tuple[int, list[_CMSG], int, Any]: ...
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> Tuple[bytes, list[_CMSG], int, Any]: ...
def recvfrom(self, bufsize: int, flags: int = ...) -> Tuple[bytes, _RetAddress]: ...
) -> tuple[int, list[_CMSG], int, Any]: ...
def recvmsg(self, __bufsize: int, __ancbufsize: int = ..., __flags: int = ...) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvfrom(self, bufsize: int, flags: int = ...) -> tuple[bytes, _RetAddress]: ...
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
def settimeout(self, value: float | None) -> None: ...
def gettimeout(self) -> float | None: ...

View File

@@ -1,7 +1,7 @@
import socket
import sys
from _typeshed import WriteableBuffer
from typing import IO, Any, Callable, ClassVar, NoReturn, Tuple, Type
from typing import IO, Any, Callable, ClassVar, NoReturn, Type
from . import events, futures, proactor_events, selector_events, streams, windows_utils
@@ -33,7 +33,7 @@ class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
def __init__(self, proactor: IocpProactor | None = ...) -> None: ...
async def create_pipe_connection(
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
) -> Tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ...
) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ...
async def start_serving_pipe(
self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str
) -> list[PipeServer]: ...

View File

@@ -1,7 +1,7 @@
import sys
from _typeshed import Self
from types import TracebackType
from typing import Callable, Protocol, Tuple, Type
from typing import Callable, Protocol, Type
class _WarnFunction(Protocol):
def __call__(self, message: str, category: Type[Warning] = ..., stacklevel: int = ..., source: PipeHandle = ...) -> None: ...
@@ -10,7 +10,7 @@ BUFSIZE: int
PIPE: int
STDOUT: int
def pipe(*, duplex: bool = ..., overlapped: Tuple[bool, bool] = ..., bufsize: int = ...) -> Tuple[int, int]: ...
def pipe(*, duplex: bool = ..., overlapped: tuple[bool, bool] = ..., bufsize: int = ...) -> tuple[int, int]: ...
class PipeHandle:
def __init__(self, handle: int) -> None: ...

View File

@@ -43,7 +43,7 @@ class dispatcher:
def listen(self, num: int) -> None: ...
def bind(self, addr: Tuple[Any, ...] | str) -> None: ...
def connect(self, address: Tuple[Any, ...] | str) -> None: ...
def accept(self) -> Tuple[_socket, Any] | None: ...
def accept(self) -> tuple[_socket, Any] | None: ...
def send(self, data: bytes) -> int: ...
def recv(self, buffer_size: int) -> bytes: ...
def close(self) -> None: ...
@@ -68,7 +68,7 @@ class dispatcher_with_send(dispatcher):
# incompatible signature:
# def send(self, data: bytes) -> int | None: ...
def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ...
def compact_traceback() -> tuple[tuple[str, str, str], type, type, str]: ...
def close_all(map: _maptype | None = ..., ignore_all: bool = ...) -> None: ...
if sys.platform != "win32":

View File

@@ -6,7 +6,7 @@ RatecvState = Tuple[int, Tuple[Tuple[int, int], ...]]
class error(Exception): ...
def add(__fragment1: bytes, __fragment2: bytes, __width: int) -> bytes: ...
def adpcm2lin(__fragment: bytes, __width: int, __state: AdpcmState | None) -> Tuple[bytes, AdpcmState]: ...
def adpcm2lin(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
def alaw2lin(__fragment: bytes, __width: int) -> bytes: ...
def avg(__fragment: bytes, __width: int) -> int: ...
def avgpp(__fragment: bytes, __width: int) -> int: ...
@@ -14,16 +14,16 @@ def bias(__fragment: bytes, __width: int, __bias: int) -> bytes: ...
def byteswap(__fragment: bytes, __width: int) -> bytes: ...
def cross(__fragment: bytes, __width: int) -> int: ...
def findfactor(__fragment: bytes, __reference: bytes) -> float: ...
def findfit(__fragment: bytes, __reference: bytes) -> Tuple[int, float]: ...
def findfit(__fragment: bytes, __reference: bytes) -> tuple[int, float]: ...
def findmax(__fragment: bytes, __length: int) -> int: ...
def getsample(__fragment: bytes, __width: int, __index: int) -> int: ...
def lin2adpcm(__fragment: bytes, __width: int, __state: AdpcmState | None) -> Tuple[bytes, AdpcmState]: ...
def lin2adpcm(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
def lin2alaw(__fragment: bytes, __width: int) -> bytes: ...
def lin2lin(__fragment: bytes, __width: int, __newwidth: int) -> bytes: ...
def lin2ulaw(__fragment: bytes, __width: int) -> bytes: ...
def max(__fragment: bytes, __width: int) -> int: ...
def maxpp(__fragment: bytes, __width: int) -> int: ...
def minmax(__fragment: bytes, __width: int) -> Tuple[int, int]: ...
def minmax(__fragment: bytes, __width: int) -> tuple[int, int]: ...
def mul(__fragment: bytes, __width: int, __factor: float) -> bytes: ...
def ratecv(
__fragment: bytes,
@@ -34,7 +34,7 @@ def ratecv(
__state: RatecvState | None,
__weightA: int = ...,
__weightB: int = ...,
) -> Tuple[bytes, RatecvState]: ...
) -> tuple[bytes, RatecvState]: ...
def reverse(__fragment: bytes, __width: int) -> bytes: ...
def rms(__fragment: bytes, __width: int) -> int: ...
def tomono(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ...

View File

@@ -56,7 +56,7 @@ class Bdb:
def get_breaks(self, filename: str, lineno: int) -> list[Breakpoint]: ...
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
def get_all_breaks(self) -> list[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> Tuple[list[Tuple[FrameType, int]], int]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ...
def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
@@ -66,7 +66,7 @@ class Bdb:
class Breakpoint:
next: int
bplist: dict[Tuple[str, int], list[Breakpoint]]
bplist: dict[tuple[str, int], list[Breakpoint]]
bpbynumber: list[Breakpoint | None]
funcname: str | None
@@ -90,5 +90,5 @@ class Breakpoint:
def __str__(self) -> str: ...
def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ...
def effective(file: str, line: int, frame: FrameType) -> Tuple[Breakpoint, bool] | Tuple[None, None]: ...
def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ...
def set_trace() -> None: ...

View File

@@ -178,7 +178,7 @@ class int:
@overload
def __new__(cls: Type[_T], x: str | bytes | bytearray, base: SupportsIndex) -> _T: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ...
def as_integer_ratio(self) -> tuple[int, Literal[1]]: ...
@property
def real(self) -> int: ...
@property
@@ -202,14 +202,14 @@ class int:
def __floordiv__(self, x: int) -> int: ...
def __truediv__(self, x: int) -> float: ...
def __mod__(self, x: int) -> int: ...
def __divmod__(self, x: int) -> Tuple[int, int]: ...
def __divmod__(self, x: int) -> tuple[int, int]: ...
def __radd__(self, x: int) -> int: ...
def __rsub__(self, x: int) -> int: ...
def __rmul__(self, x: int) -> int: ...
def __rfloordiv__(self, x: int) -> int: ...
def __rtruediv__(self, x: int) -> float: ...
def __rmod__(self, x: int) -> int: ...
def __rdivmod__(self, x: int) -> Tuple[int, int]: ...
def __rdivmod__(self, x: int) -> tuple[int, int]: ...
@overload
def __pow__(self, __x: Literal[2], __modulo: int | None = ...) -> int: ...
@overload
@@ -232,7 +232,7 @@ class int:
def __ceil__(self) -> int: ...
def __floor__(self) -> int: ...
def __round__(self, ndigits: SupportsIndex = ...) -> int: ...
def __getnewargs__(self) -> Tuple[int]: ...
def __getnewargs__(self) -> tuple[int]: ...
def __eq__(self, x: object) -> bool: ...
def __ne__(self, x: object) -> bool: ...
def __lt__(self, x: int) -> bool: ...
@@ -249,7 +249,7 @@ class int:
class float:
def __new__(cls: Type[_T], x: SupportsFloat | SupportsIndex | str | bytes | bytearray = ...) -> _T: ...
def as_integer_ratio(self) -> Tuple[int, int]: ...
def as_integer_ratio(self) -> tuple[int, int]: ...
def hex(self) -> str: ...
def is_integer(self) -> bool: ...
@classmethod
@@ -265,7 +265,7 @@ class float:
def __floordiv__(self, x: float) -> float: ...
def __truediv__(self, x: float) -> float: ...
def __mod__(self, x: float) -> float: ...
def __divmod__(self, x: float) -> Tuple[float, float]: ...
def __divmod__(self, x: float) -> tuple[float, float]: ...
def __pow__(
self, x: float, mod: None = ...
) -> float: ... # In Python 3, returns complex if self is negative and x is not whole
@@ -275,9 +275,9 @@ class float:
def __rfloordiv__(self, x: float) -> float: ...
def __rtruediv__(self, x: float) -> float: ...
def __rmod__(self, x: float) -> float: ...
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
def __rdivmod__(self, x: float) -> tuple[float, float]: ...
def __rpow__(self, x: float, mod: None = ...) -> float: ...
def __getnewargs__(self) -> Tuple[float]: ...
def __getnewargs__(self) -> tuple[float]: ...
def __trunc__(self) -> int: ...
if sys.version_info >= (3, 9):
def __ceil__(self) -> int: ...
@@ -371,7 +371,7 @@ class str(Sequence[str]):
def ljust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
def lower(self) -> str: ...
def lstrip(self, __chars: str | None = ...) -> str: ...
def partition(self, __sep: str) -> Tuple[str, str, str]: ...
def partition(self, __sep: str) -> tuple[str, str, str]: ...
def replace(self, __old: str, __new: str, __count: SupportsIndex = ...) -> str: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: str) -> str: ...
@@ -379,7 +379,7 @@ class str(Sequence[str]):
def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: str = ...) -> str: ...
def rpartition(self, __sep: str) -> Tuple[str, str, str]: ...
def rpartition(self, __sep: str) -> tuple[str, str, str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
def rstrip(self, __chars: str | None = ...) -> str: ...
def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
@@ -417,7 +417,7 @@ class str(Sequence[str]):
def __repr__(self) -> str: ...
def __rmul__(self, n: SupportsIndex) -> str: ...
def __str__(self) -> str: ...
def __getnewargs__(self) -> Tuple[str]: ...
def __getnewargs__(self) -> tuple[str]: ...
class bytes(ByteString):
@overload
@@ -466,7 +466,7 @@ class bytes(ByteString):
def ljust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
def lower(self) -> bytes: ...
def lstrip(self, __bytes: bytes | None = ...) -> bytes: ...
def partition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def partition(self, __sep: bytes) -> tuple[bytes, bytes, bytes]: ...
def replace(self, __old: bytes, __new: bytes, __count: SupportsIndex = ...) -> bytes: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytes: ...
@@ -478,7 +478,7 @@ class bytes(ByteString):
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
def rpartition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def rpartition(self, __sep: bytes) -> tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytes: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
@@ -517,7 +517,7 @@ class bytes(ByteString):
def __le__(self, x: bytes) -> bool: ...
def __gt__(self, x: bytes) -> bool: ...
def __ge__(self, x: bytes) -> bool: ...
def __getnewargs__(self) -> Tuple[bytes]: ...
def __getnewargs__(self) -> tuple[bytes]: ...
class bytearray(MutableSequence[int], ByteString):
@overload
@@ -568,7 +568,7 @@ class bytearray(MutableSequence[int], ByteString):
def ljust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
def lower(self) -> bytearray: ...
def lstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def partition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytearray: ...
def removesuffix(self, __suffix: bytes) -> bytearray: ...
@@ -580,7 +580,7 @@ class bytearray(MutableSequence[int], ByteString):
self, __sub: bytes | SupportsIndex, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
) -> int: ...
def rjust(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def rpartition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
def rstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
@@ -698,7 +698,7 @@ class bool(int):
def __rxor__(self, x: bool) -> bool: ...
@overload
def __rxor__(self, x: int) -> int: ...
def __getnewargs__(self) -> Tuple[int]: ...
def __getnewargs__(self) -> tuple[int]: ...
class slice(object):
start: Any
@@ -709,7 +709,7 @@ class slice(object):
@overload
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
__hash__: None # type: ignore
def indices(self, len: SupportsIndex) -> Tuple[int, int, int]: ...
def indices(self, len: SupportsIndex) -> tuple[int, int, int]: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ...
@@ -811,7 +811,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
# Next overload is for dict(string.split(sep) for string in iterable)
# Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error
@overload
@@ -819,12 +819,12 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
def clear(self) -> None: ...
def copy(self) -> dict[_KT, _VT]: ...
def popitem(self) -> Tuple[_KT, _VT]: ...
def popitem(self) -> tuple[_KT, _VT]: ...
def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ...
@overload
def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
@overload
def update(self, **kwargs: _VT) -> None: ...
def keys(self) -> _dict_keys[_KT, _VT]: ...
@@ -917,8 +917,8 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
def __init__(self, iterable: Iterable[_T], start: int = ...) -> None: ...
def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
def __next__(self) -> Tuple[int, _T]: ...
def __iter__(self) -> Iterator[tuple[int, _T]]: ...
def __next__(self) -> tuple[int, _T]: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
@@ -1327,13 +1327,13 @@ def vars(__object: Any = ...) -> dict[str, Any]: ...
class zip(Iterator[_T_co], Generic[_T_co]):
if sys.version_info >= (3, 10):
@overload
def __new__(cls, __iter1: Iterable[_T1], *, strict: bool = ...) -> zip[Tuple[_T1]]: ...
def __new__(cls, __iter1: Iterable[_T1], *, strict: bool = ...) -> zip[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], *, strict: bool = ...) -> zip[Tuple[_T1, _T2]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], *, strict: bool = ...) -> zip[tuple[_T1, _T2]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], *, strict: bool = ...
) -> zip[Tuple[_T1, _T2, _T3]]: ...
) -> zip[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls,
@@ -1343,7 +1343,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter4: Iterable[_T4],
*,
strict: bool = ...,
) -> zip[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
@@ -1354,7 +1354,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter5: Iterable[_T5],
*,
strict: bool = ...,
) -> zip[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
@@ -1369,15 +1369,15 @@ class zip(Iterator[_T_co], Generic[_T_co]):
) -> zip[Tuple[Any, ...]]: ...
else:
@overload
def __new__(cls, __iter1: Iterable[_T1]) -> zip[Tuple[_T1]]: ...
def __new__(cls, __iter1: Iterable[_T1]) -> zip[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> zip[Tuple[_T1, _T2]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> zip[tuple[_T1, _T2]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> zip[Tuple[_T1, _T2, _T3]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> zip[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
) -> zip[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
@@ -1386,7 +1386,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
) -> zip[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,

View File

@@ -16,7 +16,7 @@ class IllegalWeekdayError(ValueError):
def isleap(year: int) -> bool: ...
def leapdays(y1: int, y2: int) -> int: ...
def weekday(year: int, month: int, day: int) -> int: ...
def monthrange(year: int, month: int) -> Tuple[int, int]: ...
def monthrange(year: int, month: int) -> tuple[int, int]: ...
class Calendar:
firstweekday: int
@@ -25,17 +25,17 @@ class Calendar:
def setfirstweekday(self, firstweekday: int) -> None: ...
def iterweekdays(self) -> Iterable[int]: ...
def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ...
def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ...
def itermonthdays2(self, year: int, month: int) -> Iterable[tuple[int, int]]: ...
def itermonthdays(self, year: int, month: int) -> Iterable[int]: ...
def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> list[list[Tuple[int, int]]]: ...
def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[Tuple[int, int]]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
if sys.version_info >= (3, 7):
def itermonthdays3(self, year: int, month: int) -> Iterable[Tuple[int, int, int]]: ...
def itermonthdays4(self, year: int, month: int) -> Iterable[Tuple[int, int, int, int]]: ...
def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
class TextCalendar(Calendar):
def prweek(self, theweek: int, width: int) -> None: ...

View File

@@ -8,10 +8,10 @@ def reset() -> str: ... # undocumented
def small(text: str) -> str: ... # undocumented
def strong(text: str) -> str: ... # undocumented
def grey(text: str) -> str: ... # undocumented
def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> Tuple[str | None, Any]: ... # undocumented
def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> tuple[str | None, Any]: ... # undocumented
def scanvars(
reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any]
) -> list[Tuple[str, str | None, Any]]: ... # undocumented
) -> list[tuple[str, str | None, Any]]: ... # undocumented
def html(einfo: _ExcInfo, context: int = ...) -> str: ...
def text(einfo: _ExcInfo, context: int = ...) -> str: ...

View File

@@ -1,4 +1,4 @@
from typing import SupportsComplex, SupportsFloat, Tuple, Union
from typing import SupportsComplex, SupportsFloat, Union
e: float
pi: float
@@ -25,7 +25,7 @@ def isnan(__z: _C) -> bool: ...
def log(__x: _C, __y_obj: _C = ...) -> complex: ...
def log10(__z: _C) -> complex: ...
def phase(__z: _C) -> float: ...
def polar(__z: _C) -> Tuple[float, float]: ...
def polar(__z: _C) -> tuple[float, float]: ...
def rect(__r: float, __phi: float) -> complex: ...
def sin(__z: _C) -> complex: ...
def sinh(__z: _C) -> complex: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Tuple
from typing import IO, Any, Callable
class Cmd:
prompt: str
@@ -23,7 +23,7 @@ class Cmd:
def postcmd(self, stop: bool, line: str) -> bool: ...
def preloop(self) -> None: ...
def postloop(self) -> None: ...
def parseline(self, line: str) -> Tuple[str | None, str | None, str]: ...
def parseline(self, line: str) -> tuple[str | None, str | None, str]: ...
def onecmd(self, line: str) -> bool: ...
def emptyline(self) -> bool: ...
def default(self, line: str) -> bool: ...

View File

@@ -12,10 +12,10 @@ from typing_extensions import Literal
# They are much more common in Python 2 than in Python 3.
class _Encoder(Protocol):
def __call__(self, input: str, errors: str = ...) -> Tuple[bytes, int]: ... # signature of Codec().encode
def __call__(self, input: str, errors: str = ...) -> tuple[bytes, int]: ... # signature of Codec().encode
class _Decoder(Protocol):
def __call__(self, input: bytes, errors: str = ...) -> Tuple[str, int]: ... # signature of Codec().decode
def __call__(self, input: bytes, errors: str = ...) -> tuple[str, int]: ... # signature of Codec().decode
class _StreamReader(Protocol):
def __call__(self, stream: IO[bytes], errors: str = ...) -> StreamReader: ...
@@ -63,8 +63,8 @@ def decode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = .
@overload
def decode(obj: bytes, encoding: str = ..., errors: str = ...) -> str: ...
def lookup(__encoding: str) -> CodecInfo: ...
def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> Tuple[str, int]: ... # undocumented
def utf_16_be_encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ... # undocumented
def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ... # undocumented
def utf_16_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ... # undocumented
class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
@property
@@ -124,19 +124,19 @@ BOM_UTF32_LE: bytes
# It is expected that different actions be taken depending on which of the
# three subclasses of `UnicodeError` is actually ...ed. However, the Union
# is still needed for at least one of the cases.
def register_error(__errors: str, __handler: Callable[[UnicodeError], Tuple[str | bytes, int]]) -> None: ...
def lookup_error(__name: str) -> Callable[[UnicodeError], Tuple[str | bytes, int]]: ...
def strict_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def replace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def ignore_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def backslashreplace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def register_error(__errors: str, __handler: Callable[[UnicodeError], tuple[str | bytes, int]]) -> None: ...
def lookup_error(__name: str) -> Callable[[UnicodeError], tuple[str | bytes, int]]: ...
def strict_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def replace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def ignore_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def xmlcharrefreplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def backslashreplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
class Codec:
# These are sort of @abstractmethod but sort of not.
# The StreamReader and StreamWriter subclasses only implement one.
def encode(self, input: str, errors: str = ...) -> Tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = ...) -> Tuple[str, int]: ...
def encode(self, input: str, errors: str = ...) -> tuple[bytes, int]: ...
def decode(self, input: bytes, errors: str = ...) -> tuple[str, int]: ...
class IncrementalEncoder:
errors: str
@@ -154,8 +154,8 @@ class IncrementalDecoder:
@abstractmethod
def decode(self, input: bytes, final: bool = ...) -> str: ...
def reset(self) -> None: ...
def getstate(self) -> Tuple[bytes, int]: ...
def setstate(self, state: Tuple[bytes, int]) -> None: ...
def getstate(self) -> tuple[bytes, int]: ...
def setstate(self, state: tuple[bytes, int]) -> None: ...
# These are not documented but used in encodings/*.py implementations.
class BufferedIncrementalEncoder(IncrementalEncoder):
@@ -169,7 +169,7 @@ class BufferedIncrementalDecoder(IncrementalDecoder):
buffer: bytes
def __init__(self, errors: str = ...) -> None: ...
@abstractmethod
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[str, int]: ...
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> tuple[str, int]: ...
def decode(self, input: bytes, final: bool = ...) -> str: ...
# TODO: it is not possible to specify the requirement that all other

View File

@@ -86,7 +86,7 @@ class UserString(Sequence[str]):
def __int__(self) -> int: ...
def __float__(self) -> float: ...
def __complex__(self) -> complex: ...
def __getnewargs__(self) -> Tuple[str]: ...
def __getnewargs__(self) -> tuple[str]: ...
def __lt__(self, string: str | UserString) -> bool: ...
def __le__(self, string: str | UserString) -> bool: ...
def __gt__(self, string: str | UserString) -> bool: ...
@@ -135,7 +135,7 @@ class UserString(Sequence[str]):
@staticmethod
@overload
def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ...
def partition(self, sep: str) -> Tuple[str, str, str]: ...
def partition(self, sep: str) -> tuple[str, str, str]: ...
if sys.version_info >= (3, 9):
def removeprefix(self: _UserStringT, __prefix: str | UserString) -> _UserStringT: ...
def removesuffix(self: _UserStringT, __suffix: str | UserString) -> _UserStringT: ...
@@ -143,7 +143,7 @@ class UserString(Sequence[str]):
def rfind(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
def rindex(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
def rjust(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ...
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
def rpartition(self, sep: str) -> tuple[str, str, str]: ...
def rstrip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
@@ -207,7 +207,7 @@ class Counter(Dict[_T, int], Generic[_T]):
def __init__(self, __iterable: Iterable[_T]) -> None: ...
def copy(self: _S) -> _S: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: int | None = ...) -> list[Tuple[_T, int]]: ...
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
@classmethod
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore
@overload
@@ -224,7 +224,7 @@ class Counter(Dict[_T, int], Generic[_T]):
@overload
def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...
@overload
def update(self, __m: Iterable[_T] | Iterable[Tuple[_T, int]], **kwargs: int) -> None: ...
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
@overload
def update(self, __m: None = ..., **kwargs: int) -> None: ...
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
@@ -242,7 +242,7 @@ class _OrderedDictKeysView(_dict_keys[_KT_co, _VT_co], Reversible[_KT_co]):
def __reversed__(self) -> Iterator[_KT_co]: ...
class _OrderedDictItemsView(_dict_items[_KT_co, _VT_co], Reversible[Tuple[_KT_co, _VT_co]]):
def __reversed__(self) -> Iterator[Tuple[_KT_co, _VT_co]]: ...
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
# The generics are the wrong way around because of a mypy limitation
# https://github.com/python/mypy/issues/11138
@@ -250,7 +250,7 @@ class _OrderedDictValuesView(_dict_values[_VT_co, _KT_co], Reversible[_VT_co], G
def __reversed__(self) -> Iterator[_VT_co]: ...
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
def copy(self: _S) -> _S: ...
def __reversed__(self) -> Iterator[_KT]: ...
@@ -271,9 +271,9 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __missing__(self, key: _KT) -> _VT: ...
# TODO __reversed__
def copy(self: _S) -> _S: ...

View File

@@ -1,11 +1,9 @@
from typing import Tuple
def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ...
def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ...
def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ...
def rgb_to_yiq(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def yiq_to_rgb(y: float, i: float, q: float) -> tuple[float, float, float]: ...
def rgb_to_hls(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def hls_to_rgb(h: float, l: float, s: float) -> tuple[float, float, float]: ...
def rgb_to_hsv(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def hsv_to_rgb(h: float, s: float, v: float) -> tuple[float, float, float]: ...
# TODO undocumented
ONE_SIXTH: float

View File

@@ -85,7 +85,7 @@ if sys.version_info >= (3, 7):
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[Tuple[Any, ...], None, None]: ...
def _process_chunk(fn: Callable[..., Any], chunk: Tuple[Any, None, None]) -> Generator[Any, None, None]: ...
def _process_chunk(fn: Callable[..., Any], chunk: tuple[Any, None, None]) -> Generator[Any, None, None]: ...
def _sendback_result(
result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ...
) -> None: ...

View File

@@ -1,7 +1,7 @@
import sys
from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence
from typing import Any, ClassVar, Dict, Optional, Pattern, Tuple, Type, TypeVar, overload
from typing import Any, ClassVar, Dict, Optional, Pattern, Type, TypeVar, overload
from typing_extensions import Literal
# Internal type aliases
@@ -220,7 +220,7 @@ class InterpolationSyntaxError(InterpolationError): ...
class ParsingError(Error):
source: str
errors: list[Tuple[int, str]]
errors: list[tuple[int, str]]
def __init__(self, source: str | None = ..., filename: str | None = ...) -> None: ...
def append(self, lineno: int, line: str) -> None: ...

View File

@@ -109,7 +109,7 @@ class _FuncPointer(_PointerLike, _CData):
@overload
def __init__(self, callable: Callable[..., Any]) -> None: ...
@overload
def __init__(self, func_spec: Tuple[str | int, CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ...
def __init__(self, func_spec: tuple[str | int, CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ...
@overload
def __init__(self, vtlb_index: int, name: str, paramflags: Tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
@@ -252,7 +252,7 @@ class _CField:
size: int
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[Tuple[str, Type[_CData]] | Tuple[str, Type[_CData], int]]
_fields_: Sequence[tuple[str, Type[_CData]] | tuple[str, Type[_CData], int]]
_pack_: int
_anonymous_: Sequence[str]
def __getattr__(self, name: str) -> _CField: ...

View File

@@ -19,7 +19,7 @@ if sys.version_info >= (3, 10):
@overload
def asdict(obj: Any) -> dict[str, Any]: ...
@overload
def asdict(obj: Any, *, dict_factory: Callable[[list[Tuple[str, Any]]], _T]) -> _T: ...
def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ...
@overload
def astuple(obj: Any) -> Tuple[Any, ...]: ...
@overload
@@ -190,7 +190,7 @@ class InitVar(Generic[_T]):
if sys.version_info >= (3, 10):
def make_dataclass(
cls_name: str,
fields: Iterable[str | Tuple[str, type] | Tuple[str, type, Field[Any]]],
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
namespace: dict[str, Any] | None = ...,
@@ -207,7 +207,7 @@ if sys.version_info >= (3, 10):
else:
def make_dataclass(
cls_name: str,
fields: Iterable[str | Tuple[str, type] | Tuple[str, type, Field[Any]]],
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
namespace: dict[str, Any] | None = ...,

View File

@@ -1,6 +1,6 @@
import sys
from time import struct_time
from typing import ClassVar, NamedTuple, SupportsAbs, Tuple, Type, TypeVar, overload
from typing import ClassVar, NamedTuple, SupportsAbs, Type, TypeVar, overload
_S = TypeVar("_S")
@@ -79,7 +79,7 @@ class date:
if sys.version_info >= (3, 9):
def isocalendar(self) -> _IsoCalendarDate: ...
else:
def isocalendar(self) -> Tuple[int, int, int]: ...
def isocalendar(self) -> tuple[int, int, int]: ...
class time:
min: ClassVar[time]
@@ -174,7 +174,7 @@ class timedelta(SupportsAbs[timedelta]):
@overload
def __truediv__(self, other: float) -> timedelta: ...
def __mod__(self, other: timedelta) -> timedelta: ...
def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ...
def __divmod__(self, other: timedelta) -> tuple[int, timedelta]: ...
def __le__(self, other: timedelta) -> bool: ...
def __lt__(self, other: timedelta) -> bool: ...
def __ge__(self, other: timedelta) -> bool: ...
@@ -295,4 +295,4 @@ class datetime(date):
if sys.version_info >= (3, 9):
def isocalendar(self) -> _IsoCalendarDate: ...
else:
def isocalendar(self) -> Tuple[int, int, int]: ...
def isocalendar(self) -> tuple[int, int, int]: ...

View File

@@ -54,11 +54,11 @@ class Decimal(object):
def compare(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __hash__(self) -> int: ...
def as_tuple(self) -> DecimalTuple: ...
def as_integer_ratio(self) -> Tuple[int, int]: ...
def as_integer_ratio(self) -> tuple[int, int]: ...
def to_eng_string(self, context: Context | None = ...) -> str: ...
def __abs__(self) -> Decimal: ...
def __add__(self, other: _Decimal) -> Decimal: ...
def __divmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ...
def __divmod__(self, other: _Decimal) -> tuple[Decimal, Decimal]: ...
def __eq__(self, other: object) -> bool: ...
def __floordiv__(self, other: _Decimal) -> Decimal: ...
def __ge__(self, other: _ComparableNum) -> bool: ...
@@ -71,7 +71,7 @@ class Decimal(object):
def __pos__(self) -> Decimal: ...
def __pow__(self, other: _Decimal, modulo: _Decimal | None = ...) -> Decimal: ...
def __radd__(self, other: _Decimal) -> Decimal: ...
def __rdivmod__(self, other: _Decimal) -> Tuple[Decimal, Decimal]: ...
def __rdivmod__(self, other: _Decimal) -> tuple[Decimal, Decimal]: ...
def __rfloordiv__(self, other: _Decimal) -> Decimal: ...
def __rmod__(self, other: _Decimal) -> Decimal: ...
def __rmul__(self, other: _Decimal) -> Decimal: ...
@@ -143,7 +143,7 @@ class Decimal(object):
def rotate(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __reduce__(self) -> Tuple[Type[Decimal], Tuple[str]]: ...
def __reduce__(self) -> tuple[Type[Decimal], tuple[str]]: ...
def __copy__(self) -> Decimal: ...
def __deepcopy__(self, memo: Any) -> Decimal: ...
def __format__(self, specifier: str, context: Context | None = ...) -> str: ...
@@ -181,7 +181,7 @@ class Context(object):
# __setattr__() only allows to set a specific set of attributes,
# already defined above.
def __delattr__(self, name: str) -> None: ...
def __reduce__(self) -> Tuple[Type[Context], Tuple[Any, ...]]: ...
def __reduce__(self) -> tuple[Type[Context], Tuple[Any, ...]]: ...
def clear_flags(self) -> None: ...
def clear_traps(self) -> None: ...
def copy(self) -> Context: ...
@@ -204,7 +204,7 @@ class Context(object):
def copy_sign(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide_int(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divmod(self, __x: _Decimal, __y: _Decimal) -> Tuple[Decimal, Decimal]: ...
def divmod(self, __x: _Decimal, __y: _Decimal) -> tuple[Decimal, Decimal]: ...
def exp(self, __x: _Decimal) -> Decimal: ...
def fma(self, __x: _Decimal, __y: _Decimal, __z: _Decimal) -> Decimal: ...
def is_canonical(self, __x: _Decimal) -> bool: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, Tuple, TypeVar, Union, overload
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -24,8 +24,8 @@ class SequenceMatcher(Generic[_T]):
else:
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
def get_matching_blocks(self) -> list[Match]: ...
def get_opcodes(self) -> list[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[Tuple[str, int, int, int, int]]]: ...
def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...

View File

@@ -16,7 +16,7 @@ from opcode import (
opname as opname,
stack_effect as stack_effect,
)
from typing import IO, Any, Callable, Iterator, NamedTuple, Tuple, Union
from typing import IO, Any, Callable, Iterator, NamedTuple, Union
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
# for functions (python/mypy#3171)
@@ -47,7 +47,7 @@ class Bytecode:
COMPILER_FLAG_NAMES: dict[int, str]
def findlabels(code: _have_code) -> list[int]: ...
def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
def findlinestarts(code: _have_code) -> Iterator[tuple[int, int]]: ...
def pretty_flags(flags: int) -> str: ...
def code_info(x: _have_code_or_string) -> str: ...

View File

@@ -1,9 +1,9 @@
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, Tuple
from typing import Any, Callable, Iterable
class Command:
sub_commands: list[Tuple[str, Callable[[Command], bool] | None]]
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@@ -18,7 +18,7 @@ class Command:
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: str, *option_pairs: Tuple[str, str]) -> None: ...
def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ...
def get_finalized_command(self, command: str, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | str, reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: str) -> None: ...
@@ -34,7 +34,7 @@ class Command:
preserve_times: int = ...,
link: str | None = ...,
level: Any = ...,
) -> Tuple[str, bool]: ... # level is not used
) -> tuple[str, bool]: ... # level is not used
def copy_tree(
self,
infile: str,
@@ -57,7 +57,7 @@ class Command:
) -> str: ...
def make_file(
self,
infiles: str | list[str] | Tuple[str],
infiles: str | list[str] | tuple[str],
outfile: str,
func: Callable[..., Any],
args: list[Any],

View File

@@ -1,7 +1,7 @@
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any, Mapping, Tuple, Type
from typing import Any, Mapping, Type
def setup(
*,
@@ -28,13 +28,13 @@ def setup(
keywords: list[str] | str = ...,
platforms: list[str] | str = ...,
cmdclass: Mapping[str, Type[Command]] = ...,
data_files: list[Tuple[str, list[str]]] = ...,
data_files: list[tuple[str, list[str]]] = ...,
package_dir: Mapping[str, str] = ...,
obsoletes: list[str] = ...,
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ...,
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
libraries: list[str] = ...,

View File

@@ -1,5 +1,3 @@
from typing import Tuple
def newer(source: str, target: str) -> bool: ...
def newer_pairwise(sources: list[str], targets: list[str]) -> list[Tuple[str, str]]: ...
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import StrOrBytesPath, SupportsWrite
from distutils.cmd import Command
from typing import IO, Any, Iterable, Mapping, Tuple, Type
from typing import IO, Any, Iterable, Mapping, Type
class DistributionMetadata:
def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ...
@@ -53,6 +53,6 @@ class Distribution:
cmdclass: dict[str, Type[Command]]
metadata: DistributionMetadata
def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ...
def get_option_dict(self, command: str) -> dict[str, Tuple[str, str]]: ...
def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ...
def parse_config_files(self, filenames: Iterable[str] | None = ...) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...

View File

@@ -1,12 +1,10 @@
from typing import Tuple
class Extension:
def __init__(
self,
name: str,
sources: list[str],
include_dirs: list[str] | None = ...,
define_macros: list[Tuple[str, str | None]] | None = ...,
define_macros: list[tuple[str, str | None]] | None = ...,
undef_macros: list[str] | None = ...,
library_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,

View File

@@ -15,7 +15,7 @@ class FancyGetopt:
def getopt(self, args: list[str] | None = ...) -> _GR: ...
@overload
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[Tuple[str, str]]: ...
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> list[str]: ...
class OptionDummy:

View File

@@ -1,4 +1,4 @@
from typing import Sequence, Tuple
from typing import Sequence
def copy_file(
src: str,
@@ -9,6 +9,6 @@ def copy_file(
link: str | None = ...,
verbose: bool = ...,
dry_run: bool = ...,
) -> Tuple[str, str]: ...
) -> tuple[str, str]: ...
def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ...
def write_file(filename: str, contents: Sequence[str]) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Tuple
from typing import IO
class TextFile:
def __init__(
@@ -15,7 +15,7 @@ class TextFile:
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(self, msg: str, line: list[int] | Tuple[int, int] | int | None = ...) -> None: ...
def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = ...) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...

View File

@@ -21,8 +21,8 @@ class Version:
class StrictVersion(Version):
version_re: Pattern[str]
version: Tuple[int, int, int]
prerelease: Tuple[str, int] | None
version: tuple[int, int, int]
prerelease: tuple[str, int] | None
def __init__(self, vstring: str | None = ...) -> None: ...
def parse(self: _T, vstring: str) -> _T: ...
def __str__(self) -> str: ...

View File

@@ -1,7 +1,7 @@
import sys
from email.errors import HeaderParseError, MessageDefect
from email.policy import Policy
from typing import Any, Iterable, Iterator, List, Pattern, Set, Tuple, Type, TypeVar, Union
from typing import Any, Iterable, Iterator, List, Pattern, Set, Type, TypeVar, Union
from typing_extensions import Final
_T = TypeVar("_T")
@@ -281,12 +281,12 @@ class MimeParameters(TokenList):
token_type: str
syntactic_break: bool
@property
def params(self) -> Iterator[Tuple[str, str]]: ...
def params(self) -> Iterator[tuple[str, str]]: ...
class ParameterizedHeaderValue(TokenList):
syntactic_break: bool
@property
def params(self) -> Iterable[Tuple[str, str]]: ...
def params(self) -> Iterable[tuple[str, str]]: ...
class ContentType(ParameterizedHeaderValue):
token_type: str
@@ -334,7 +334,7 @@ class Terminal(str):
def pop_trailing_ws(self) -> None: ...
@property
def comments(self) -> list[str]: ...
def __getnewargs__(self) -> Tuple[str, str]: ... # type: ignore
def __getnewargs__(self) -> tuple[str, str]: ... # type: ignore
class WhiteSpaceTerminal(Terminal):
@property
@@ -356,55 +356,55 @@ DOT: Final[ValueTerminal]
ListSeparator: Final[ValueTerminal]
RouteComponentMarker: Final[ValueTerminal]
def get_fws(value: str) -> Tuple[WhiteSpaceTerminal, str]: ...
def get_encoded_word(value: str) -> Tuple[EncodedWord, str]: ...
def get_fws(value: str) -> tuple[WhiteSpaceTerminal, str]: ...
def get_encoded_word(value: str) -> tuple[EncodedWord, str]: ...
def get_unstructured(value: str) -> UnstructuredTokenList: ...
def get_qp_ctext(value: str) -> Tuple[WhiteSpaceTerminal, str]: ...
def get_qcontent(value: str) -> Tuple[ValueTerminal, str]: ...
def get_atext(value: str) -> Tuple[ValueTerminal, str]: ...
def get_bare_quoted_string(value: str) -> Tuple[BareQuotedString, str]: ...
def get_comment(value: str) -> Tuple[Comment, str]: ...
def get_cfws(value: str) -> Tuple[CFWSList, str]: ...
def get_quoted_string(value: str) -> Tuple[QuotedString, str]: ...
def get_atom(value: str) -> Tuple[Atom, str]: ...
def get_dot_atom_text(value: str) -> Tuple[DotAtomText, str]: ...
def get_dot_atom(value: str) -> Tuple[DotAtom, str]: ...
def get_word(value: str) -> Tuple[Any, str]: ...
def get_phrase(value: str) -> Tuple[Phrase, str]: ...
def get_local_part(value: str) -> Tuple[LocalPart, str]: ...
def get_obs_local_part(value: str) -> Tuple[ObsLocalPart, str]: ...
def get_dtext(value: str) -> Tuple[ValueTerminal, str]: ...
def get_domain_literal(value: str) -> Tuple[DomainLiteral, str]: ...
def get_domain(value: str) -> Tuple[Domain, str]: ...
def get_addr_spec(value: str) -> Tuple[AddrSpec, str]: ...
def get_obs_route(value: str) -> Tuple[ObsRoute, str]: ...
def get_angle_addr(value: str) -> Tuple[AngleAddr, str]: ...
def get_display_name(value: str) -> Tuple[DisplayName, str]: ...
def get_name_addr(value: str) -> Tuple[NameAddr, str]: ...
def get_mailbox(value: str) -> Tuple[Mailbox, str]: ...
def get_invalid_mailbox(value: str, endchars: str) -> Tuple[InvalidMailbox, str]: ...
def get_mailbox_list(value: str) -> Tuple[MailboxList, str]: ...
def get_group_list(value: str) -> Tuple[GroupList, str]: ...
def get_group(value: str) -> Tuple[Group, str]: ...
def get_address(value: str) -> Tuple[Address, str]: ...
def get_address_list(value: str) -> Tuple[AddressList, str]: ...
def get_qp_ctext(value: str) -> tuple[WhiteSpaceTerminal, str]: ...
def get_qcontent(value: str) -> tuple[ValueTerminal, str]: ...
def get_atext(value: str) -> tuple[ValueTerminal, str]: ...
def get_bare_quoted_string(value: str) -> tuple[BareQuotedString, str]: ...
def get_comment(value: str) -> tuple[Comment, str]: ...
def get_cfws(value: str) -> tuple[CFWSList, str]: ...
def get_quoted_string(value: str) -> tuple[QuotedString, str]: ...
def get_atom(value: str) -> tuple[Atom, str]: ...
def get_dot_atom_text(value: str) -> tuple[DotAtomText, str]: ...
def get_dot_atom(value: str) -> tuple[DotAtom, str]: ...
def get_word(value: str) -> tuple[Any, str]: ...
def get_phrase(value: str) -> tuple[Phrase, str]: ...
def get_local_part(value: str) -> tuple[LocalPart, str]: ...
def get_obs_local_part(value: str) -> tuple[ObsLocalPart, str]: ...
def get_dtext(value: str) -> tuple[ValueTerminal, str]: ...
def get_domain_literal(value: str) -> tuple[DomainLiteral, str]: ...
def get_domain(value: str) -> tuple[Domain, str]: ...
def get_addr_spec(value: str) -> tuple[AddrSpec, str]: ...
def get_obs_route(value: str) -> tuple[ObsRoute, str]: ...
def get_angle_addr(value: str) -> tuple[AngleAddr, str]: ...
def get_display_name(value: str) -> tuple[DisplayName, str]: ...
def get_name_addr(value: str) -> tuple[NameAddr, str]: ...
def get_mailbox(value: str) -> tuple[Mailbox, str]: ...
def get_invalid_mailbox(value: str, endchars: str) -> tuple[InvalidMailbox, str]: ...
def get_mailbox_list(value: str) -> tuple[MailboxList, str]: ...
def get_group_list(value: str) -> tuple[GroupList, str]: ...
def get_group(value: str) -> tuple[Group, str]: ...
def get_address(value: str) -> tuple[Address, str]: ...
def get_address_list(value: str) -> tuple[AddressList, str]: ...
if sys.version_info >= (3, 8):
def get_no_fold_literal(value: str) -> Tuple[NoFoldLiteral, str]: ...
def get_msg_id(value: str) -> Tuple[MsgID, str]: ...
def get_no_fold_literal(value: str) -> tuple[NoFoldLiteral, str]: ...
def get_msg_id(value: str) -> tuple[MsgID, str]: ...
def parse_message_id(value: str) -> MessageID: ...
def parse_mime_version(value: str) -> MIMEVersion: ...
def get_invalid_parameter(value: str) -> Tuple[InvalidParameter, str]: ...
def get_ttext(value: str) -> Tuple[ValueTerminal, str]: ...
def get_token(value: str) -> Tuple[Token, str]: ...
def get_attrtext(value: str) -> Tuple[ValueTerminal, str]: ...
def get_attribute(value: str) -> Tuple[Attribute, str]: ...
def get_extended_attrtext(value: str) -> Tuple[ValueTerminal, str]: ...
def get_extended_attribute(value: str) -> Tuple[Attribute, str]: ...
def get_section(value: str) -> Tuple[Section, str]: ...
def get_value(value: str) -> Tuple[Value, str]: ...
def get_parameter(value: str) -> Tuple[Parameter, str]: ...
def get_invalid_parameter(value: str) -> tuple[InvalidParameter, str]: ...
def get_ttext(value: str) -> tuple[ValueTerminal, str]: ...
def get_token(value: str) -> tuple[Token, str]: ...
def get_attrtext(value: str) -> tuple[ValueTerminal, str]: ...
def get_attribute(value: str) -> tuple[Attribute, str]: ...
def get_extended_attrtext(value: str) -> tuple[ValueTerminal, str]: ...
def get_extended_attribute(value: str) -> tuple[Attribute, str]: ...
def get_section(value: str) -> tuple[Section, str]: ...
def get_value(value: str) -> tuple[Value, str]: ...
def get_parameter(value: str) -> tuple[Parameter, str]: ...
def parse_mime_parameters(value: str) -> MimeParameters: ...
def parse_content_type_header(value: str) -> ContentType: ...
def parse_content_disposition_header(value: str) -> ContentDisposition: ...

View File

@@ -1,5 +1,5 @@
from email.charset import Charset
from typing import Any, Tuple
from typing import Any
class Header:
def __init__(
@@ -17,9 +17,9 @@ class Header:
def __eq__(self, other: Any) -> bool: ...
def __ne__(self, other: Any) -> bool: ...
def decode_header(header: Header | str) -> list[Tuple[bytes, str | None]]: ...
def decode_header(header: Header | str) -> list[tuple[bytes, str | None]]: ...
def make_header(
decoded_seq: list[Tuple[bytes, str | None]],
decoded_seq: list[tuple[bytes, str | None]],
maxlinelen: int | None = ...,
header_name: str | None = ...,
continuation_ws: str = ...,

View File

@@ -34,7 +34,7 @@ class Message:
def __delitem__(self, name: str) -> None: ...
def keys(self) -> list[str]: ...
def values(self) -> list[_HeaderType]: ...
def items(self) -> list[Tuple[str, _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 add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ...
@@ -44,7 +44,7 @@ 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 = ..., unquote: bool = ...) -> list[Tuple[str, str]] | _T: ...
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[tuple[str, str]] | _T: ...
def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ...
def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ...
def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ...

View File

@@ -3,7 +3,7 @@ from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.header import Header
from email.message import Message
from typing import Any, Callable, Tuple
from typing import Any, Callable
class Policy:
max_line_length: int | None
@@ -17,9 +17,9 @@ class Policy:
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
def header_max_count(self, name: str) -> int | None: ...
@abstractmethod
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
@abstractmethod
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
@abstractmethod
def header_fetch_parse(self, name: str, value: str) -> str: ...
@abstractmethod
@@ -28,8 +28,8 @@ class Policy:
def fold_binary(self, name: str, value: str) -> bytes: ...
class Compat32(Policy):
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore
def fold(self, name: str, value: str) -> str: ...
def fold_binary(self, name: str, value: str) -> bytes: ...
@@ -41,8 +41,8 @@ class EmailPolicy(Policy):
refold_source: str
header_factory: Callable[[str, str], str]
content_manager: ContentManager
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
def header_fetch_parse(self, name: str, value: str) -> str: ...
def fold(self, name: str, value: str) -> str: ...
def fold_binary(self, name: str, value: str) -> bytes: ...

View File

@@ -8,13 +8,13 @@ _PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
def quote(str: str) -> str: ...
def unquote(str: str) -> str: ...
def parseaddr(addr: str | None) -> Tuple[str, str]: ...
def formataddr(pair: Tuple[str | None, str], charset: str | Charset = ...) -> str: ...
def getaddresses(fieldvalues: list[str]) -> list[Tuple[str, str]]: ...
def parseaddr(addr: str | None) -> tuple[str, str]: ...
def formataddr(pair: tuple[str | None, str], charset: str | Charset = ...) -> str: ...
def getaddresses(fieldvalues: list[str]) -> list[tuple[str, str]]: ...
@overload
def parsedate(data: None) -> None: ...
@overload
def parsedate(data: str) -> Tuple[int, int, int, int, int, int, int, int, int] | None: ...
def parsedate(data: str) -> tuple[int, int, int, int, int, int, int, int, int] | None: ...
@overload
def parsedate_tz(data: None) -> None: ...
@overload
@@ -34,7 +34,7 @@ def formatdate(timeval: float | None = ..., localtime: bool = ..., usegmt: bool
def format_datetime(dt: datetime.datetime, usegmt: bool = ...) -> str: ...
def localtime(dt: datetime.datetime | None = ..., isdst: int = ...) -> datetime.datetime: ...
def make_msgid(idstring: str | None = ..., domain: str | None = ...) -> str: ...
def decode_rfc2231(s: str) -> Tuple[str | None, str | None, str]: ...
def decode_rfc2231(s: str) -> tuple[str | None, str | None, str]: ...
def encode_rfc2231(s: str, charset: str | None = ..., language: str | None = ...) -> str: ...
def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ...
def decode_params(params: list[Tuple[str, str]]) -> list[Tuple[str, _ParamType]]: ...
def decode_params(params: list[tuple[str, str]]) -> list[tuple[str, _ParamType]]: ...

View File

@@ -1,21 +1,20 @@
import codecs
from typing import Tuple
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: str, final: bool = ...) -> bytes: ...
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
@staticmethod
def _buffer_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> Tuple[str, int]: ...
def _buffer_decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
class StreamWriter(codecs.StreamWriter):
@staticmethod
def encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
class StreamReader(codecs.StreamReader):
@staticmethod
def decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> Tuple[str, int]: ...
def decode(__data: bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
def getregentry() -> codecs.CodecInfo: ...
def encode(__str: str, __errors: str | None = ...) -> Tuple[bytes, int]: ...
def decode(input: bytes, errors: str | None = ...) -> Tuple[str, int]: ...
def encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
def decode(input: bytes, errors: str | None = ...) -> tuple[str, int]: ...

View File

@@ -1,7 +1,7 @@
import sys
from _typeshed import StrOrBytesPath
from os import PathLike
from typing import Any, AnyStr, Callable, Generic, Iterable, Sequence, Tuple
from typing import Any, AnyStr, Callable, Generic, Iterable, Sequence
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -11,7 +11,7 @@ DEFAULT_IGNORES: list[str]
def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: int | bool = ...) -> bool: ...
def cmpfiles(
a: AnyStr | PathLike[AnyStr], b: AnyStr | PathLike[AnyStr], common: Iterable[AnyStr], shallow: int | bool = ...
) -> Tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ...
) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
def __init__(

View File

@@ -1,7 +1,7 @@
import sys
from decimal import Decimal
from numbers import Integral, Rational, Real
from typing import Tuple, Type, TypeVar, Union, overload
from typing import Type, TypeVar, Union, overload
from typing_extensions import Literal
_ComparableNum = Union[int, float, Decimal, Real]
@@ -30,7 +30,7 @@ class Fraction(Rational):
def from_decimal(cls, dec: Decimal) -> Fraction: ...
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, int]: ...
def as_integer_ratio(self) -> tuple[int, int]: ...
@property
def numerator(self) -> int: ...
@property
@@ -100,13 +100,13 @@ class Fraction(Rational):
@overload
def __rmod__(self, other: float) -> float: ...
@overload
def __divmod__(self, other: int | Fraction) -> Tuple[int, Fraction]: ...
def __divmod__(self, other: int | Fraction) -> tuple[int, Fraction]: ...
@overload
def __divmod__(self, other: float) -> Tuple[float, Fraction]: ...
def __divmod__(self, other: float) -> tuple[float, Fraction]: ...
@overload
def __rdivmod__(self, other: int | Fraction) -> Tuple[int, Fraction]: ...
def __rdivmod__(self, other: int | Fraction) -> tuple[int, Fraction]: ...
@overload
def __rdivmod__(self, other: float) -> Tuple[float, Fraction]: ...
def __rdivmod__(self, other: float) -> tuple[float, Fraction]: ...
@overload
def __pow__(self, other: int) -> Fraction: ...
@overload

View File

@@ -41,7 +41,7 @@ class FTP:
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
source_address: Tuple[str, int] | None
source_address: tuple[str, int] | None
if sys.version_info >= (3, 9):
def __init__(
self,
@@ -50,7 +50,7 @@ class FTP:
passwd: str = ...,
acct: str = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
encoding: str = ...,
) -> None: ...
@@ -62,10 +62,10 @@ class FTP:
passwd: str = ...,
acct: str = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
) -> None: ...
def connect(
self, host: str = ..., port: int = ..., timeout: float = ..., source_address: Tuple[str, int] | None = ...
self, host: str = ..., port: int = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
) -> str: ...
def getwelcome(self) -> str: ...
def set_debuglevel(self, level: int) -> None: ...
@@ -84,10 +84,10 @@ class FTP:
def sendport(self, host: str, port: int) -> str: ...
def sendeprt(self, host: str, port: int) -> str: ...
def makeport(self) -> socket: ...
def makepasv(self) -> Tuple[str, int]: ...
def makepasv(self) -> tuple[str, int]: ...
def login(self, user: str = ..., passwd: str = ..., acct: str = ...) -> str: ...
# In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers.
def ntransfercmd(self, cmd: str, rest: int | str | None = ...) -> Tuple[socket, int]: ...
def ntransfercmd(self, cmd: str, rest: int | str | None = ...) -> tuple[socket, int]: ...
def transfercmd(self, cmd: str, rest: int | str | None = ...) -> socket: ...
def retrbinary(
self, cmd: str, callback: Callable[[bytes], Any], blocksize: int = ..., rest: int | str | None = ...
@@ -106,7 +106,7 @@ class FTP:
def nlst(self, *args: str) -> list[str]: ...
# Technically only the last arg can be a Callable but ...
def dir(self, *args: str | Callable[[str], None]) -> None: ...
def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[Tuple[str, dict[str, str]]]: ...
def mlsd(self, path: str = ..., facts: Iterable[str] = ...) -> Iterator[tuple[str, dict[str, str]]]: ...
def rename(self, fromname: str, toname: str) -> str: ...
def delete(self, filename: str) -> str: ...
def cwd(self, dirname: str) -> str: ...
@@ -129,7 +129,7 @@ class FTP_TLS(FTP):
certfile: str | None = ...,
context: SSLContext | None = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
encoding: str = ...,
) -> None: ...
@@ -144,7 +144,7 @@ class FTP_TLS(FTP):
certfile: str | None = ...,
context: SSLContext | None = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
) -> None: ...
ssl_version: int
keyfile: str | None
@@ -157,8 +157,8 @@ class FTP_TLS(FTP):
def ccc(self) -> str: ...
def parse150(resp: str) -> int | None: ... # undocumented
def parse227(resp: str) -> Tuple[str, int]: ... # undocumented
def parse229(resp: str, peer: Any) -> Tuple[str, int]: ... # undocumented
def parse227(resp: str) -> tuple[str, int]: ... # undocumented
def parse229(resp: str, peer: Any) -> tuple[str, int]: ... # undocumented
def parse257(resp: str) -> str: ... # undocumented
def ftpcp(
source: FTP, sourcename: str, target: FTP, targetname: str = ..., type: Literal["A", "I"] = ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Tuple
from typing import Any
DEBUG_COLLECTABLE: int
DEBUG_LEAK: int
@@ -12,7 +12,7 @@ garbage: list[Any]
def collect(generation: int = ...) -> int: ...
def disable() -> None: ...
def enable() -> None: ...
def get_count() -> Tuple[int, int, int]: ...
def get_count() -> tuple[int, int, int]: ...
def get_debug() -> int: ...
if sys.version_info >= (3, 8):
@@ -29,7 +29,7 @@ if sys.version_info >= (3, 7):
def get_referents(*objs: Any) -> list[Any]: ...
def get_referrers(*objs: Any) -> list[Any]: ...
def get_stats() -> list[dict[str, Any]]: ...
def get_threshold() -> Tuple[int, int, int]: ...
def get_threshold() -> tuple[int, int, int]: ...
def is_tracked(__obj: Any) -> bool: ...
if sys.version_info >= (3, 9):

View File

@@ -6,11 +6,11 @@ class HTMLParser(ParserBase):
def feed(self, data: str) -> None: ...
def close(self) -> None: ...
def reset(self) -> None: ...
def getpos(self) -> Tuple[int, int]: ...
def getpos(self) -> tuple[int, int]: ...
def get_starttag_text(self) -> str | None: ...
def handle_starttag(self, tag: str, attrs: list[Tuple[str, str | None]]) -> None: ...
def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ...
def handle_endtag(self, tag: str) -> None: ...
def handle_startendtag(self, tag: str, attrs: list[Tuple[str, str | None]]) -> None: ...
def handle_startendtag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ...
def handle_data(self, data: str) -> None: ...
def handle_entityref(self, name: str) -> None: ...
def handle_charref(self, name: str) -> None: ...

View File

@@ -5,7 +5,7 @@ import sys
import types
from _typeshed import Self, WriteableBuffer
from socket import socket
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Tuple, Type, TypeVar, Union, overload
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Type, TypeVar, Union, overload
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
_T = TypeVar("_T")
@@ -96,7 +96,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
def getheader(self, name: str) -> str | None: ...
@overload
def getheader(self, name: str, default: _T) -> str | _T: ...
def getheaders(self) -> list[Tuple[str, str]]: ...
def getheaders(self) -> list[tuple[str, str]]: ...
def fileno(self) -> int: ...
def isclosed(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...
@@ -118,12 +118,12 @@ class _HTTPConnectionProtocol(Protocol):
host: str,
port: int | None = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> HTTPConnection: ...
else:
def __call__(
self, host: str, port: int | None = ..., timeout: float = ..., source_address: Tuple[str, int] | None = ...
self, host: str, port: int | None = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
) -> HTTPConnection: ...
class HTTPConnection:
@@ -141,12 +141,12 @@ class HTTPConnection:
host: str,
port: int | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> None: ...
else:
def __init__(
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: Tuple[str, int] | None = ...
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
) -> None: ...
def request(
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
@@ -170,7 +170,7 @@ class HTTPSConnection(HTTPConnection):
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
@@ -184,7 +184,7 @@ class HTTPSConnection(HTTPConnection):
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, Generic, Iterable, Mapping, Tuple, TypeVar, Union, overload
from typing import Any, Dict, Generic, Iterable, Mapping, TypeVar, Union, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -32,7 +32,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
@overload # type: ignore
def update(self, values: Mapping[str, str]) -> None: ...
@overload
def update(self, values: Iterable[Tuple[str, str]]) -> None: ...
def update(self, values: Iterable[tuple[str, str]]) -> None: ...
def isReservedKey(self, K: str) -> bool: ...
def output(self, attrs: list[str] | None = ..., header: str = ...) -> str: ...
def js_output(self, attrs: list[str] | None = ...) -> str: ...

View File

@@ -3,7 +3,7 @@ import io
import socketserver
import sys
from _typeshed import StrPath, SupportsRead, SupportsWrite
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence, Tuple
from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence
class HTTPServer(socketserver.TCPServer):
server_name: str
@@ -14,7 +14,7 @@ if sys.version_info >= (3, 7):
daemon_threads: bool # undocumented
class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
client_address: Tuple[str, int]
client_address: tuple[str, int]
server: socketserver.BaseServer
close_connection: bool
requestline: str
@@ -28,11 +28,11 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
error_content_type: str
protocol_version: str
MessageClass: type
responses: Mapping[int, Tuple[str, str]]
responses: Mapping[int, tuple[str, str]]
default_request_version: str # undocumented
weekdayname: ClassVar[Sequence[str]] # undocumented
monthname: ClassVar[Sequence[str | None]] # undocumented
def __init__(self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer) -> None: ...
def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ...
def handle(self) -> None: ...
def handle_one_request(self) -> None: ...
def handle_expect_100(self) -> bool: ...
@@ -56,10 +56,10 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
extensions_map: dict[str, str]
if sys.version_info >= (3, 7):
def __init__(
self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer, directory: str | None = ...
) -> None: ...
else:
def __init__(self, request: bytes, client_address: Tuple[str, int], server: socketserver.BaseServer) -> None: ...
def __init__(self, request: bytes, client_address: tuple[str, int], server: socketserver.BaseServer) -> None: ...
def do_GET(self) -> None: ...
def do_HEAD(self) -> None: ...
def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented

View File

@@ -25,14 +25,14 @@ class IMAP4:
state: str
literal: str | None
tagged_commands: dict[bytes, _list[bytes] | None]
untagged_responses: dict[str, _list[bytes | Tuple[bytes, bytes]]]
untagged_responses: dict[str, _list[bytes | tuple[bytes, bytes]]]
continuation_response: str
is_readonly: bool
tagnum: int
tagpre: str
tagre: Pattern[str]
welcome: bytes
capabilities: Tuple[str]
capabilities: tuple[str]
PROTOCOL_VERSION: str
if sys.version_info >= (3, 9):
def __init__(self, host: str = ..., port: int = ..., timeout: float | None = ...) -> None: ...
@@ -53,7 +53,7 @@ class IMAP4:
def recent(self) -> _CommandResults: ...
def response(self, code: str) -> _CommandResults: ...
def append(self, mailbox: str, flags: str, date_time: str, message: str) -> str: ...
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> Tuple[str, str]: ...
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
def capability(self) -> _CommandResults: ...
def check(self) -> _CommandResults: ...
def close(self) -> _CommandResults: ...
@@ -65,29 +65,29 @@ class IMAP4:
def __enter__(self: Self) -> Self: ...
def __exit__(self, t: Type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
def expunge(self) -> _CommandResults: ...
def fetch(self, message_set: str, message_parts: str) -> Tuple[str, _AnyResponseData]: ...
def fetch(self, message_set: str, message_parts: str) -> tuple[str, _AnyResponseData]: ...
def getacl(self, mailbox: str) -> _CommandResults: ...
def getannotation(self, mailbox: str, entry: str, attribute: str) -> _CommandResults: ...
def getquota(self, root: str) -> _CommandResults: ...
def getquotaroot(self, mailbox: str) -> _CommandResults: ...
def list(self, directory: str = ..., pattern: str = ...) -> Tuple[str, _AnyResponseData]: ...
def login(self, user: str, password: str) -> Tuple[Literal["OK"], _list[bytes]]: ...
def list(self, directory: str = ..., pattern: str = ...) -> tuple[str, _AnyResponseData]: ...
def login(self, user: str, password: str) -> tuple[Literal["OK"], _list[bytes]]: ...
def login_cram_md5(self, user: str, password: str) -> _CommandResults: ...
def logout(self) -> Tuple[str, _AnyResponseData]: ...
def logout(self) -> tuple[str, _AnyResponseData]: ...
def lsub(self, directory: str = ..., pattern: str = ...) -> _CommandResults: ...
def myrights(self, mailbox: str) -> _CommandResults: ...
def namespace(self) -> _CommandResults: ...
def noop(self) -> Tuple[str, _list[bytes]]: ...
def noop(self) -> tuple[str, _list[bytes]]: ...
def partial(self, message_num: str, message_part: str, start: str, length: str) -> _CommandResults: ...
def proxyauth(self, user: str) -> _CommandResults: ...
def rename(self, oldmailbox: str, newmailbox: str) -> _CommandResults: ...
def search(self, charset: str | None, *criteria: str) -> _CommandResults: ...
def select(self, mailbox: str = ..., readonly: bool = ...) -> Tuple[str, _list[bytes | None]]: ...
def select(self, mailbox: str = ..., readonly: bool = ...) -> tuple[str, _list[bytes | None]]: ...
def setacl(self, mailbox: str, who: str, what: str) -> _CommandResults: ...
def setannotation(self, *args: str) -> _CommandResults: ...
def setquota(self, root: str, limits: str) -> _CommandResults: ...
def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> _CommandResults: ...
def starttls(self, ssl_context: Any | None = ...) -> Tuple[Literal["OK"], _list[None]]: ...
def starttls(self, ssl_context: Any | None = ...) -> tuple[Literal["OK"], _list[None]]: ...
def status(self, mailbox: str, names: str) -> _CommandResults: ...
def store(self, message_set: str, command: str, flags: str) -> _CommandResults: ...
def subscribe(self, mailbox: str) -> _CommandResults: ...
@@ -165,5 +165,5 @@ class _Authenticator:
def Internaldate2tuple(resp: str) -> time.struct_time: ...
def Int2AP(num: int) -> str: ...
def ParseFlags(resp: str) -> Tuple[str]: ...
def ParseFlags(resp: str) -> tuple[str]: ...
def Time2Internaldate(date_time: float | time.struct_time | str) -> str: ...

View File

@@ -1,7 +1,7 @@
import types
from _typeshed import StrPath
from os import PathLike
from typing import IO, Any, Protocol, Tuple, TypeVar
from typing import IO, Any, Protocol, TypeVar
from _imp import (
acquire_lock as acquire_lock,
@@ -33,7 +33,7 @@ def get_magic() -> bytes: ...
def get_tag() -> str: ...
def cache_from_source(path: StrPath, debug_override: bool | None = ...) -> str: ...
def source_from_cache(path: StrPath) -> str: ...
def get_suffixes() -> list[Tuple[str, str, int]]: ...
def get_suffixes() -> list[tuple[str, str, int]]: ...
class NullImporter:
def __init__(self, path: StrPath) -> None: ...
@@ -53,12 +53,12 @@ class _FileLike(Protocol):
def load_source(name: str, pathname: str, file: _FileLike | None = ...) -> types.ModuleType: ...
def load_compiled(name: str, pathname: str, file: _FileLike | None = ...) -> types.ModuleType: ...
def load_package(name: str, path: StrPath) -> types.ModuleType: ...
def load_module(name: str, file: _FileLike | None, filename: str, details: Tuple[str, str, int]) -> types.ModuleType: ...
def load_module(name: str, file: _FileLike | None, filename: str, details: tuple[str, str, int]) -> types.ModuleType: ...
# IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise.
def find_module(
name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = ...
) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ...
) -> tuple[IO[Any], str, tuple[str, str, int]]: ...
def reload(module: types.ModuleType) -> types.ModuleType: ...
def init_builtin(name: str) -> types.ModuleType | None: ...
def load_dynamic(name: str, path: str, file: Any = ...) -> types.ModuleType: ... # file argument is ignored

View File

@@ -12,7 +12,7 @@ from _typeshed import (
from abc import ABCMeta, abstractmethod
from importlib.machinery import ModuleSpec
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Tuple, Union, overload
from typing import IO, Any, BinaryIO, Iterator, Mapping, Protocol, Sequence, Union, overload
from typing_extensions import Literal, runtime_checkable
_Path = Union[bytes, str]
@@ -55,7 +55,7 @@ class MetaPathFinder(Finder):
class PathEntryFinder(Finder):
def find_module(self, fullname: str) -> Loader | None: ...
def find_loader(self, fullname: str) -> Tuple[Loader | None, Sequence[_Path]]: ...
def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[_Path]]: ...
def invalidate_caches(self) -> None: ...
# Not defined on the actual class, but expected to exist.
def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ...

View File

@@ -1,6 +1,6 @@
import importlib.abc
import types
from typing import Any, Callable, Sequence, Tuple
from typing import Any, Callable, Sequence
# TODO: the loaders seem a bit backwards, attribute is protocol but __init__ arg isn't?
class ModuleSpec:
@@ -100,10 +100,10 @@ def all_suffixes() -> list[str]: ...
class FileFinder(importlib.abc.PathEntryFinder):
path: str
def __init__(self, path: str, *loader_details: Tuple[importlib.abc.Loader, list[str]]) -> None: ...
def __init__(self, path: str, *loader_details: tuple[importlib.abc.Loader, list[str]]) -> None: ...
@classmethod
def path_hook(
cls, *loader_details: Tuple[importlib.abc.Loader, list[str]]
cls, *loader_details: tuple[importlib.abc.Loader, list[str]]
) -> Callable[[str], importlib.abc.PathEntryFinder]: ...
class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader):

View File

@@ -32,7 +32,7 @@ class BlockFinder:
indecorator: bool
decoratorhasargs: bool
last: int
def tokeneater(self, type: int, token: str, srowcol: Tuple[int, int], erowcol: Tuple[int, int], line: str) -> None: ...
def tokeneater(self, type: int, token: str, srowcol: tuple[int, int], erowcol: tuple[int, int], line: str) -> None: ...
CO_OPTIMIZED: int
CO_NEWLOCALS: int
@@ -46,7 +46,7 @@ CO_ITERABLE_COROUTINE: int
CO_ASYNC_GENERATOR: int
TPFLAGS_IS_ABSTRACT: int
def getmembers(object: object, predicate: Callable[[Any], bool] | None = ...) -> list[Tuple[str, Any]]: ...
def getmembers(object: object, predicate: Callable[[Any], bool] | None = ...) -> list[tuple[str, Any]]: ...
def getmodulename(path: str) -> str | None: ...
def ismodule(object: object) -> TypeGuard[ModuleType]: ...
def isclass(object: object) -> TypeGuard[Type[Any]]: ...
@@ -88,7 +88,7 @@ def ismemberdescriptor(object: object) -> bool: ...
#
_SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, TracebackType, FrameType, CodeType, Callable[..., Any]]
def findsource(object: _SourceObjectType) -> Tuple[list[str], int]: ...
def findsource(object: _SourceObjectType) -> tuple[list[str], int]: ...
def getabsfile(object: _SourceObjectType, _filename: str | None = ...) -> str: ...
def getblock(lines: Sequence[str]) -> Sequence[str]: ...
def getdoc(object: object) -> str | None: ...
@@ -96,7 +96,7 @@ def getcomments(object: object) -> str | None: ...
def getfile(object: _SourceObjectType) -> str: ...
def getmodule(object: object, _filename: str | None = ...) -> ModuleType | None: ...
def getsourcefile(object: _SourceObjectType) -> str | None: ...
def getsourcelines(object: _SourceObjectType) -> Tuple[list[str], int]: ...
def getsourcelines(object: _SourceObjectType) -> tuple[list[str], int]: ...
def getsource(object: _SourceObjectType) -> str: ...
def cleandoc(doc: str) -> str: ...
def indentsize(line: str) -> int: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Container, Generic, Iterable, Iterator, SupportsInt, Tuple, TypeVar, overload
from typing import Any, Container, Generic, Iterable, Iterator, SupportsInt, TypeVar, overload
# Undocumented length constants
IPV4LENGTH: int
@@ -126,7 +126,7 @@ class IPv6Address(_BaseAddress):
@property
def sixtofour(self) -> IPv4Address | None: ...
@property
def teredo(self) -> Tuple[IPv4Address, IPv4Address] | None: ...
def teredo(self) -> tuple[IPv4Address, IPv4Address] | None: ...
class IPv6Network(_BaseNetwork[IPv6Address]):
@property
@@ -142,11 +142,11 @@ def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[I
def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ...
def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ...
@overload
def get_mixed_type_key(obj: _A) -> Tuple[int, _A]: ...
def get_mixed_type_key(obj: _A) -> tuple[int, _A]: ...
@overload
def get_mixed_type_key(obj: IPv4Network) -> Tuple[int, IPv4Address, IPv4Address]: ...
def get_mixed_type_key(obj: IPv4Network) -> tuple[int, IPv4Address, IPv4Address]: ...
@overload
def get_mixed_type_key(obj: IPv6Network) -> Tuple[int, IPv6Address, IPv6Address]: ...
def get_mixed_type_key(obj: IPv6Network) -> tuple[int, IPv6Address, IPv6Address]: ...
class AddressValueError(ValueError): ...
class NetmaskValueError(ValueError): ...

View File

@@ -91,8 +91,8 @@ class groupby(Iterator[Tuple[_T, Iterator[_S]]], Generic[_T, _S]):
def __new__(cls, iterable: Iterable[_T1], key: None = ...) -> groupby[_T1, _T1]: ...
@overload
def __new__(cls, iterable: Iterable[_T1], key: Callable[[_T1], _T2]) -> groupby[_T2, _T1]: ...
def __iter__(self) -> Iterator[Tuple[_T, Iterator[_S]]]: ...
def __next__(self) -> Tuple[_T, Iterator[_S]]: ...
def __iter__(self) -> Iterator[tuple[_T, Iterator[_S]]]: ...
def __next__(self) -> tuple[_T, Iterator[_S]]: ...
class islice(Iterator[_T], Generic[_T]):
@overload
@@ -126,15 +126,15 @@ _T6 = TypeVar("_T6")
class product(Iterator[_T_co], Generic[_T_co]):
@overload
def __new__(cls, __iter1: Iterable[_T1]) -> product[Tuple[_T1]]: ...
def __new__(cls, __iter1: Iterable[_T1]) -> product[tuple[_T1]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> product[Tuple[_T1, _T2]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> product[tuple[_T1, _T2]]: ...
@overload
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> product[Tuple[_T1, _T2, _T3]]: ...
def __new__(cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> product[tuple[_T1, _T2, _T3]]: ...
@overload
def __new__(
cls, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
) -> product[Tuple[_T1, _T2, _T3, _T4]]: ...
) -> product[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
def __new__(
cls,
@@ -143,7 +143,7 @@ class product(Iterator[_T_co], Generic[_T_co]):
__iter3: Iterable[_T3],
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
) -> product[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
) -> product[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
def __new__(
cls,
@@ -153,7 +153,7 @@ class product(Iterator[_T_co], Generic[_T_co]):
__iter4: Iterable[_T4],
__iter5: Iterable[_T5],
__iter6: Iterable[_T6],
) -> product[Tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
def __new__(
cls,
@@ -180,13 +180,13 @@ class permutations(Iterator[Tuple[_T, ...]], Generic[_T]):
class combinations(Iterator[_T_co], Generic[_T_co]):
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations[Tuple[_T, _T]]: ...
def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations[tuple[_T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> combinations[Tuple[_T, _T, _T]]: ...
def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> combinations[tuple[_T, _T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> combinations[Tuple[_T, _T, _T, _T]]: ...
def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> combinations[tuple[_T, _T, _T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations[Tuple[_T, _T, _T, _T, _T]]: ...
def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations[tuple[_T, _T, _T, _T, _T]]: ...
@overload
def __new__(cls, iterable: Iterable[_T], r: int) -> combinations[Tuple[_T, ...]]: ...
def __iter__(self) -> Iterator[_T_co]: ...
@@ -199,6 +199,6 @@ class combinations_with_replacement(Iterator[Tuple[_T, ...]], Generic[_T]):
if sys.version_info >= (3, 10):
class pairwise(Iterator[_T_co], Generic[_T_co]):
def __new__(cls, __iterable: Iterable[_T]) -> pairwise[Tuple[_T, _T]]: ...
def __new__(cls, __iterable: Iterable[_T]) -> pairwise[tuple[_T, _T]]: ...
def __iter__(self) -> Iterator[_T_co]: ...
def __next__(self) -> _T_co: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import SupportsRead
from typing import IO, Any, Callable, Tuple, Type
from typing import IO, Any, Callable, Type
from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder
from .encoder import JSONEncoder as JSONEncoder
@@ -13,7 +13,7 @@ def dumps(
allow_nan: bool = ...,
cls: Type[JSONEncoder] | None = ...,
indent: None | int | str = ...,
separators: Tuple[str, str] | None = ...,
separators: tuple[str, str] | None = ...,
default: Callable[[Any], Any] | None = ...,
sort_keys: bool = ...,
**kwds: Any,
@@ -28,7 +28,7 @@ def dump(
allow_nan: bool = ...,
cls: Type[JSONEncoder] | None = ...,
indent: None | int | str = ...,
separators: Tuple[str, str] | None = ...,
separators: tuple[str, str] | None = ...,
default: Callable[[Any], Any] | None = ...,
sort_keys: bool = ...,
**kwds: Any,
@@ -41,7 +41,7 @@ def loads(
parse_float: Callable[[str], Any] | None = ...,
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
object_pairs_hook: Callable[[list[Tuple[Any, Any]]], Any] | None = ...,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
**kwds: Any,
) -> Any: ...
def load(
@@ -52,7 +52,7 @@ def load(
parse_float: Callable[[str], Any] | None = ...,
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
object_pairs_hook: Callable[[list[Tuple[Any, Any]]], Any] | None = ...,
object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = ...,
**kwds: Any,
) -> Any: ...
def detect_encoding(b: bytes) -> str: ... # undocumented

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Tuple
from typing import Any, Callable
class JSONDecodeError(ValueError):
msg: str
@@ -14,7 +14,7 @@ class JSONDecoder:
parse_int: Callable[[str], Any]
parse_constant: Callable[[str], Any]
strict: bool
object_pairs_hook: Callable[[list[Tuple[str, Any]]], Any]
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any]
def __init__(
self,
*,
@@ -23,7 +23,7 @@ class JSONDecoder:
parse_int: Callable[[str], Any] | None = ...,
parse_constant: Callable[[str], Any] | None = ...,
strict: bool = ...,
object_pairs_hook: Callable[[list[Tuple[str, Any]]], Any] | None = ...,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = ...,
) -> None: ...
def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented
def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ...
def raw_decode(self, s: str, idx: int = ...) -> tuple[Any, int]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Iterator, Tuple
from typing import Any, Callable, Iterator
def py_encode_basestring(s: str) -> str: ... # undocumented
def py_encode_basestring_ascii(s: str) -> str: ... # undocumented
@@ -22,7 +22,7 @@ class JSONEncoder:
allow_nan: bool = ...,
sort_keys: bool = ...,
indent: int | None = ...,
separators: Tuple[str, str] | None = ...,
separators: tuple[str, str] | None = ...,
default: Callable[..., Any] | None = ...,
) -> None: ...
def default(self, o: Any) -> Any: ...

View File

@@ -1,6 +1,6 @@
from lib2to3.pgen2.grammar import _DFAS, Grammar
from lib2to3.pytree import _NL, _Convert, _RawNode
from typing import Any, Sequence, Set, Tuple
from typing import Any, Sequence, Set
_Context = Sequence[Any]
@@ -14,7 +14,7 @@ class ParseError(Exception):
class Parser:
grammar: Grammar
convert: _Convert
stack: list[Tuple[_DFAS, int, _RawNode]]
stack: list[tuple[_DFAS, int, _RawNode]]
rootnode: _NL | None
used_names: Set[str]
def __init__(self, grammar: Grammar, convert: _Convert | None = ...) -> None: ...

View File

@@ -1,7 +1,7 @@
from _typeshed import StrPath
from lib2to3.pgen2 import grammar
from lib2to3.pgen2.tokenize import _TokenInfo
from typing import IO, Any, Iterable, Iterator, NoReturn, Tuple
from typing import IO, Any, Iterable, Iterator, NoReturn
class PgenGrammar(grammar.Grammar): ...
@@ -16,21 +16,21 @@ class ParserGenerator:
def make_label(self, c: PgenGrammar, label: str) -> int: ...
def addfirstsets(self) -> None: ...
def calcfirst(self, name: str) -> None: ...
def parse(self) -> Tuple[dict[str, list[DFAState]], str]: ...
def parse(self) -> tuple[dict[str, list[DFAState]], str]: ...
def make_dfa(self, start: NFAState, finish: NFAState) -> list[DFAState]: ...
def dump_nfa(self, name: str, start: NFAState, finish: NFAState) -> list[DFAState]: ...
def dump_dfa(self, name: str, dfa: Iterable[DFAState]) -> None: ...
def simplify_dfa(self, dfa: list[DFAState]) -> None: ...
def parse_rhs(self) -> Tuple[NFAState, NFAState]: ...
def parse_alt(self) -> Tuple[NFAState, NFAState]: ...
def parse_item(self) -> Tuple[NFAState, NFAState]: ...
def parse_atom(self) -> Tuple[NFAState, NFAState]: ...
def parse_rhs(self) -> tuple[NFAState, NFAState]: ...
def parse_alt(self) -> tuple[NFAState, NFAState]: ...
def parse_item(self) -> tuple[NFAState, NFAState]: ...
def parse_atom(self) -> tuple[NFAState, NFAState]: ...
def expect(self, type: int, value: Any | None = ...) -> str: ...
def gettoken(self) -> None: ...
def raise_error(self, msg: str, *args: Any) -> NoReturn: ...
class NFAState:
arcs: list[Tuple[str | None, NFAState]]
arcs: list[tuple[str | None, NFAState]]
def __init__(self) -> None: ...
def addarc(self, next: NFAState, label: str | None = ...) -> None: ...

View File

@@ -17,7 +17,7 @@ class Untokenizer:
def __init__(self) -> None: ...
def add_whitespace(self, start: _Coord) -> None: ...
def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ...
def compat(self, token: Tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ...
def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ...
def untokenize(iterable: Iterable[_TokenInfo]) -> str: ...
def generate_tokens(readline: Callable[[], str]) -> Iterator[_TokenInfo]: ...

View File

@@ -68,7 +68,7 @@ class BasePattern:
def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns
def match(self, node: _NL, results: _Results | None = ...) -> bool: ...
def match_seq(self, nodes: list[_NL], results: _Results | None = ...) -> bool: ...
def generate_matches(self, nodes: list[_NL]) -> Iterator[Tuple[int, _Results]]: ...
def generate_matches(self, nodes: list[_NL]) -> Iterator[tuple[int, _Results]]: ...
class LeafPattern(BasePattern):
def __init__(self, type: int | None = ..., content: str | None = ..., name: str | None = ...) -> None: ...
@@ -85,4 +85,4 @@ class WildcardPattern(BasePattern):
class NegatedPattern(BasePattern):
def __init__(self, content: str | None = ...) -> None: ...
def generate_matches(patterns: list[BasePattern], nodes: list[_NL]) -> Iterator[Tuple[int, _Results]]: ...
def generate_matches(patterns: list[BasePattern], nodes: list[_NL]) -> Iterator[tuple[int, _Results]]: ...

View File

@@ -82,7 +82,7 @@ class Error(Exception): ...
def setlocale(category: int, locale: _str | Iterable[_str] | None = ...) -> _str: ...
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 getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> tuple[_str | None, _str | None]: ...
def getlocale(category: int = ...) -> Sequence[_str]: ...
def getpreferredencoding(do_setlocale: bool = ...) -> _str: ...
def normalize(localename: _str) -> _str: ...

View File

@@ -32,7 +32,7 @@ from posixpath import (
splitext as splitext,
supports_unicode_filenames as supports_unicode_filenames,
)
from typing import AnyStr, Tuple, overload
from typing import AnyStr, overload
altsep: str | None
@@ -64,6 +64,6 @@ def join(s: StrPath, *paths: StrPath) -> str: ...
@overload
def join(s: BytesPath, *paths: BytesPath) -> bytes: ...
@overload
def split(s: PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
def split(s: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ...
@overload
def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def split(s: AnyStr) -> tuple[AnyStr, AnyStr]: ...

View File

@@ -13,7 +13,6 @@ from typing import (
Mapping,
Protocol,
Sequence,
Tuple,
Type,
TypeVar,
Union,
@@ -29,10 +28,10 @@ _MessageT = TypeVar("_MessageT", bound=Message)
_MessageData = Union[email.message.Message, bytes, str, IO[str], IO[bytes]]
class _HasIteritems(Protocol):
def iteritems(self) -> Iterator[Tuple[str, _MessageData]]: ...
def iteritems(self) -> Iterator[tuple[str, _MessageData]]: ...
class _HasItems(Protocol):
def items(self) -> Iterator[Tuple[str, _MessageData]]: ...
def items(self) -> Iterator[tuple[str, _MessageData]]: ...
linesep: bytes
@@ -63,8 +62,8 @@ class Mailbox(Generic[_MessageT]):
def itervalues(self) -> Iterator[_MessageT]: ...
def __iter__(self) -> Iterator[_MessageT]: ...
def values(self) -> list[_MessageT]: ...
def iteritems(self) -> Iterator[Tuple[str, _MessageT]]: ...
def items(self) -> list[Tuple[str, _MessageT]]: ...
def iteritems(self) -> Iterator[tuple[str, _MessageT]]: ...
def items(self) -> list[tuple[str, _MessageT]]: ...
def __contains__(self, key: str) -> bool: ...
def __len__(self) -> int: ...
def clear(self) -> None: ...
@@ -72,8 +71,8 @@ class Mailbox(Generic[_MessageT]):
def pop(self, key: str, default: None = ...) -> _MessageT | None: ...
@overload
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: ...
def popitem(self) -> tuple[str, _MessageT]: ...
def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = ...) -> None: ...
def flush(self) -> None: ...
def lock(self) -> None: ...
def unlock(self) -> None: ...
@@ -149,7 +148,7 @@ class MaildirMessage(Message):
class _mboxMMDFMessage(Message):
def get_from(self) -> str: ...
def set_from(self, from_: str, time_: bool | Tuple[int, int, int, int, int, int, int, int, int] | None = ...) -> None: ...
def set_from(self, from_: str, time_: bool | tuple[int, int, int, int, int, int, int, int, int] | None = ...) -> None: ...
def get_flags(self) -> str: ...
def set_flags(self, flags: Iterable[str]) -> None: ...
def add_flag(self, flag: str) -> None: ...

View File

@@ -1,8 +1,8 @@
from typing import Dict, Mapping, Sequence, Tuple, Union
from typing import Dict, Mapping, Sequence, Union
_Cap = Dict[str, Union[str, int]]
def findmatch(
caps: Mapping[str, list[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...
) -> Tuple[str | None, _Cap | None]: ...
) -> tuple[str | None, _Cap | None]: ...
def getcaps() -> dict[str, list[_Cap]]: ...

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import SupportsTrunc
from typing import Iterable, SupportsFloat, SupportsInt, Tuple, overload
from typing import Iterable, SupportsFloat, SupportsInt, overload
e: float
pi: float
@@ -36,7 +36,7 @@ def fabs(__x: SupportsFloat) -> float: ...
def factorial(__x: SupportsInt) -> int: ...
def floor(__x: SupportsFloat) -> int: ...
def fmod(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
def frexp(__x: SupportsFloat) -> Tuple[float, int]: ...
def frexp(__x: SupportsFloat) -> tuple[float, int]: ...
def fsum(__seq: Iterable[float]) -> float: ...
def gamma(__x: SupportsFloat) -> float: ...
@@ -69,7 +69,7 @@ def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ...
def log10(__x: SupportsFloat) -> float: ...
def log1p(__x: SupportsFloat) -> float: ...
def log2(__x: SupportsFloat) -> float: ...
def modf(__x: SupportsFloat) -> Tuple[float, float]: ...
def modf(__x: SupportsFloat) -> tuple[float, float]: ...
if sys.version_info >= (3, 9):
def nextafter(__x: SupportsFloat, __y: SupportsFloat) -> float: ...

View File

@@ -3,10 +3,10 @@ from _typeshed import StrPath
from typing import IO, Sequence, Tuple
if sys.version_info >= (3, 8):
def guess_type(url: StrPath, strict: bool = ...) -> Tuple[str | None, str | None]: ...
def guess_type(url: StrPath, strict: bool = ...) -> 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 = ...) -> tuple[str | None, str | None]: ...
def guess_all_extensions(type: str, strict: bool = ...) -> list[str]: ...
def guess_extension(type: str, strict: bool = ...) -> str | None: ...
@@ -24,11 +24,11 @@ common_types: dict[str, str]
class MimeTypes:
suffix_map: dict[str, str]
encodings_map: dict[str, str]
types_map: Tuple[dict[str, str], dict[str, str]]
types_map_inv: Tuple[dict[str, str], dict[str, str]]
types_map: tuple[dict[str, str], dict[str, str]]
types_map_inv: tuple[dict[str, str], dict[str, str]]
def __init__(self, filenames: Tuple[str, ...] = ..., strict: bool = ...) -> None: ...
def guess_extension(self, type: str, strict: bool = ...) -> str | None: ...
def guess_type(self, url: str, strict: bool = ...) -> Tuple[str | None, str | None]: ...
def guess_type(self, url: str, strict: bool = ...) -> tuple[str | None, str | None]: ...
def guess_all_extensions(self, type: str, strict: bool = ...) -> list[str]: ...
def read(self, filename: str, strict: bool = ...) -> None: ...
def readfp(self, fp: IO[str], strict: bool = ...) -> None: ...

View File

@@ -6,7 +6,7 @@ LOAD_CONST: int # undocumented
IMPORT_NAME: int # undocumented
STORE_NAME: int # undocumented
STORE_GLOBAL: int # undocumented
STORE_OPS: Tuple[int, int] # undocumented
STORE_OPS: tuple[int, int] # undocumented
EXTENDED_ARG: int # undocumented
packagePathMap: dict[str, list[str]] # undocumented
@@ -29,7 +29,7 @@ class ModuleFinder:
debug: int # undocumented
indent: int # undocumented
excludes: Container[str] # undocumented
replace_paths: Sequence[Tuple[str, str]] # undocumented
replace_paths: Sequence[tuple[str, str]] # undocumented
if sys.version_info >= (3, 8):
def __init__(
@@ -37,7 +37,7 @@ class ModuleFinder:
path: list[str] | None = ...,
debug: int = ...,
excludes: Container[str] | None = ...,
replace_paths: Sequence[Tuple[str, str]] | None = ...,
replace_paths: Sequence[tuple[str, str]] | None = ...,
) -> None: ...
else:
def __init__(
@@ -45,7 +45,7 @@ class ModuleFinder:
path: list[str] | None = ...,
debug: int = ...,
excludes: Container[str] = ...,
replace_paths: Sequence[Tuple[str, str]] = ...,
replace_paths: Sequence[tuple[str, str]] = ...,
) -> None: ...
def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented
def msgin(self, *args: Any) -> None: ... # undocumented
@@ -56,20 +56,20 @@ class ModuleFinder:
self, name: str, caller: Module | None = ..., fromlist: list[str] | None = ..., level: int = ...
) -> Module | None: ... # undocumented
def determine_parent(self, caller: Module | None, level: int = ...) -> Module | None: ... # undocumented
def find_head_package(self, parent: Module, name: str) -> Tuple[Module, str]: ... # undocumented
def find_head_package(self, parent: Module, name: str) -> tuple[Module, str]: ... # undocumented
def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented
def ensure_fromlist(self, m: Module, fromlist: Iterable[str], recursive: int = ...) -> None: ... # undocumented
def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented
def import_module(self, partname: str, fqname: str, parent: Module) -> Module | None: ... # undocumented
def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: Tuple[str, str, str]) -> Module: ... # undocumented
def scan_opcodes(self, co: CodeType) -> Iterator[Tuple[str, Tuple[Any, ...]]]: ... # undocumented
def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: tuple[str, str, str]) -> Module: ... # undocumented
def scan_opcodes(self, co: CodeType) -> Iterator[tuple[str, Tuple[Any, ...]]]: ... # undocumented
def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented
def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented
def add_module(self, fqname: str) -> Module: ... # undocumented
def find_module(
self, name: str, path: str | None, parent: Module | None = ...
) -> Tuple[IO[Any] | None, str | None, Tuple[str, str, int]]: ... # undocumented
) -> tuple[IO[Any] | None, str | None, tuple[str, str, int]]: ... # undocumented
def report(self) -> None: ...
def any_missing(self) -> list[str]: ... # undocumented
def any_missing_maybe(self) -> Tuple[list[str], list[str]]: ... # undocumented
def any_missing_maybe(self) -> tuple[list[str], list[str]]: ... # undocumented
def replace_paths_in_code(self, co: CodeType) -> CodeType: ... # undocumented

View File

@@ -25,14 +25,14 @@ if sys.platform == "win32":
class Table:
name: str
fields: list[Tuple[int, str, int]]
fields: list[tuple[int, str, int]]
def __init__(self, name: str) -> None: ...
def add_field(self, index: int, name: str, type: int) -> None: ...
def sql(self) -> str: ...
def create(self, db: _Database) -> None: ...
class _Unspecified: ...
def change_sequence(
seq: Sequence[Tuple[str, str | None, int]],
seq: Sequence[tuple[str, str | None, int]],
action: str,
seqno: int | Type[_Unspecified] = ...,
cond: str | Type[_Unspecified] = ...,
@@ -48,12 +48,12 @@ if sys.platform == "win32":
class CAB:
name: str
files: list[Tuple[str, str]]
files: list[tuple[str, str]]
filenames: Set[str]
index: int
def __init__(self, name: str) -> None: ...
def gen_id(self, file: str) -> str: ...
def append(self, full: str, file: str, logical: str) -> Tuple[int, str]: ...
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
def commit(self, db: _Database) -> None: ...
_directories: Set[str]
class Directory:

View File

@@ -1,5 +1,4 @@
import sys
from typing import Tuple
if sys.platform == "win32":
from . import Table
@@ -92,4 +91,4 @@ if sys.platform == "win32":
tables: list[Table]
_Validation_records: list[Tuple[str, str, str, int | None, int | None, str | None, int | None, str | None, str | None, str]]
_Validation_records: list[tuple[str, str, str, int | None, int | None, str | None, int | None, str | None, str | None, str]]

View File

@@ -1,9 +1,8 @@
import sys
from typing import Tuple
if sys.platform == "win32":
ActionText: list[Tuple[str, str, str | None]]
UIText: list[Tuple[str, str | None]]
ActionText: list[tuple[str, str, str | None]]
UIText: list[tuple[str, str | None]]
tables: list[str]

View File

@@ -60,4 +60,4 @@ def wait(
object_list: Iterable[Connection | socket.socket | int], timeout: float | None = ...
) -> list[Connection | socket.socket | int]: ...
def Client(address: _Address, family: str | None = ..., authkey: bytes | None = ...) -> Connection: ...
def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ...
def Pipe(duplex: bool = ...) -> tuple[Connection, Connection]: ...

View File

@@ -35,4 +35,4 @@ class Listener(object):
def close(self) -> None: ...
def Client(address: _Address) -> Connection: ...
def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ...
def Pipe(duplex: bool = ...) -> tuple[Connection, Connection]: ...

Some files were not shown because too many files have changed in this diff Show More