mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 21:31:09 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import codecs
|
||||
import sys
|
||||
from typing import Any, Callable, Dict, Tuple, Union
|
||||
from typing import Any, Callable, Union
|
||||
|
||||
# This type is not exposed; it is defined in unicodeobject.c
|
||||
class _EncodingMap:
|
||||
def size(self) -> int: ...
|
||||
|
||||
_MapT = Union[Dict[int, int], _EncodingMap]
|
||||
_Handler = Callable[[Exception], Tuple[str, int]]
|
||||
_MapT = Union[dict[int, int], _EncodingMap]
|
||||
_Handler = Callable[[Exception], tuple[str, int]]
|
||||
|
||||
def register(__search_function: Callable[[str], Any]) -> None: ...
|
||||
def register_error(__errors: str, __handler: _Handler) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import WriteableBuffer
|
||||
from io import BufferedIOBase, RawIOBase
|
||||
from typing import Any, Callable, Protocol, Tuple, Type
|
||||
from typing import Any, Callable, Protocol, Type
|
||||
|
||||
BUFFER_SIZE: Any
|
||||
|
||||
@@ -16,7 +16,7 @@ class DecompressReader(RawIOBase):
|
||||
self,
|
||||
fp: _Reader,
|
||||
decomp_factory: Callable[..., object],
|
||||
trailing_error: Type[Exception] | Tuple[Type[Exception], ...] = ...,
|
||||
trailing_error: Type[Exception] | tuple[Type[Exception], ...] = ...,
|
||||
**decomp_args: Any,
|
||||
) -> None: ...
|
||||
def readable(self) -> bool: ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Iterable, Iterator, List, Protocol, Type, Union
|
||||
from typing import Any, Iterable, Iterator, Protocol, Type, Union
|
||||
|
||||
QUOTE_ALL: int
|
||||
QUOTE_MINIMAL: int
|
||||
@@ -20,7 +20,7 @@ class Dialect:
|
||||
|
||||
_DialectLike = Union[str, Dialect, Type[Dialect]]
|
||||
|
||||
class _reader(Iterator[List[str]]):
|
||||
class _reader(Iterator[list[str]]):
|
||||
dialect: Dialect
|
||||
line_num: int
|
||||
def __next__(self) -> list[str]: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Callable, NoReturn, Tuple
|
||||
from typing import Any, Callable, NoReturn
|
||||
|
||||
TIMEOUT_MAX: int
|
||||
error = RuntimeError
|
||||
|
||||
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ...
|
||||
def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> None: ...
|
||||
def exit() -> NoReturn: ...
|
||||
def get_ident() -> int: ...
|
||||
def allocate_lock() -> LockType: ...
|
||||
|
||||
@@ -13,7 +13,6 @@ from typing import (
|
||||
Protocol,
|
||||
Sequence,
|
||||
SupportsAbs,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
@@ -99,7 +98,7 @@ class attrgetter(Generic[_T_co]):
|
||||
@overload
|
||||
def __new__(cls, attr: str, __attr2: str, __attr3: str, __attr4: str) -> attrgetter[tuple[Any, Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, attr: str, *attrs: str) -> attrgetter[Tuple[Any, ...]]: ...
|
||||
def __new__(cls, attr: str, *attrs: str) -> attrgetter[tuple[Any, ...]]: ...
|
||||
def __call__(self, obj: Any) -> _T_co: ...
|
||||
|
||||
@final
|
||||
@@ -113,7 +112,7 @@ class itemgetter(Generic[_T_co]):
|
||||
@overload
|
||||
def __new__(cls, item: Any, __item2: Any, __item3: Any, __item4: Any) -> itemgetter[tuple[Any, Any, Any, Any]]: ...
|
||||
@overload
|
||||
def __new__(cls, item: Any, *items: Any) -> itemgetter[Tuple[Any, ...]]: ...
|
||||
def __new__(cls, item: Any, *items: Any) -> itemgetter[tuple[Any, ...]]: ...
|
||||
def __call__(self, obj: Any) -> _T_co: ...
|
||||
|
||||
@final
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Iterable, Sequence, Tuple, TypeVar
|
||||
from typing import Iterable, Sequence, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_K = TypeVar("_K")
|
||||
@@ -7,8 +7,8 @@ _V = TypeVar("_V")
|
||||
|
||||
__all__: list[str]
|
||||
|
||||
_UNIVERSAL_CONFIG_VARS: Tuple[str, ...] # undocumented
|
||||
_COMPILER_CONFIG_VARS: Tuple[str, ...] # undocumented
|
||||
_UNIVERSAL_CONFIG_VARS: tuple[str, ...] # undocumented
|
||||
_COMPILER_CONFIG_VARS: tuple[str, ...] # undocumented
|
||||
_INITPRE: str # undocumented
|
||||
|
||||
def _find_executable(executable: str, path: str | None = ...) -> str | None: ... # undocumented
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Tuple, Type, TypeVar
|
||||
from typing import Any, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -6,5 +6,5 @@ _T = TypeVar("_T")
|
||||
def get_cache_token() -> object: ...
|
||||
|
||||
class ABCMeta(type):
|
||||
def __new__(__mcls, __name: str, __bases: Tuple[Type[Any], ...], __namespace: dict[str, Any]) -> ABCMeta: ...
|
||||
def __new__(__mcls, __name: str, __bases: tuple[Type[Any], ...], __namespace: dict[str, Any]) -> ABCMeta: ...
|
||||
def register(cls, subclass: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from typing import Tuple
|
||||
|
||||
# Actually Tuple[(int,) * 625]
|
||||
_State = Tuple[int, ...]
|
||||
_State = tuple[int, ...]
|
||||
|
||||
class Random(object):
|
||||
def __init__(self, seed: object = ...) -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, WriteableBuffer
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, SupportsInt, Tuple, Union, overload
|
||||
from typing import Any, SupportsInt, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import SupportsIndex
|
||||
@@ -10,12 +10,12 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
_FD = SupportsInt
|
||||
|
||||
_CMSG = Tuple[int, int, bytes]
|
||||
_CMSGArg = Tuple[int, int, ReadableBuffer]
|
||||
_CMSG = tuple[int, int, bytes]
|
||||
_CMSGArg = tuple[int, int, ReadableBuffer]
|
||||
|
||||
# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6,
|
||||
# AF_NETLINK, AF_TIPC) or strings (AF_UNIX).
|
||||
_Address = Union[Tuple[Any, ...], str]
|
||||
_Address = Union[tuple[Any, ...], str]
|
||||
_RetAddress = Any
|
||||
# TODO Most methods allow bytes as address objects
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import structseq
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, NoReturn, Optional, Tuple, Type
|
||||
from typing import Any, Callable, NoReturn, Optional, Type
|
||||
from typing_extensions import final
|
||||
|
||||
error = RuntimeError
|
||||
@@ -21,7 +21,7 @@ class LockType:
|
||||
self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
def start_new_thread(function: Callable[..., Any], args: Tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ...
|
||||
def start_new_thread(function: Callable[..., Any], args: tuple[Any, ...], kwargs: dict[str, Any] = ...) -> int: ...
|
||||
def interrupt_main() -> None: ...
|
||||
def exit() -> NoReturn: ...
|
||||
def allocate_lock() -> LockType: ...
|
||||
@@ -34,7 +34,7 @@ if sys.version_info >= (3, 8):
|
||||
def get_native_id() -> int: ... # only available on some platforms
|
||||
@final
|
||||
class _ExceptHookArgs(
|
||||
structseq[Any], Tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]
|
||||
structseq[Any], tuple[Type[BaseException], Optional[BaseException], Optional[TracebackType], Optional[Thread]]
|
||||
):
|
||||
@property
|
||||
def exc_type(self) -> Type[BaseException]: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Dict
|
||||
from typing import Any
|
||||
from weakref import ReferenceType
|
||||
|
||||
localdict = Dict[Any, Any]
|
||||
localdict = dict[Any, Any]
|
||||
|
||||
class _localimpl:
|
||||
key: str
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# See the README.md file in this directory for more information.
|
||||
|
||||
from sys import _OptExcInfo
|
||||
from typing import Any, Callable, Dict, Iterable, Protocol
|
||||
from typing import Any, Callable, Iterable, Protocol
|
||||
|
||||
# stable
|
||||
class StartResponse(Protocol):
|
||||
@@ -11,7 +11,7 @@ class StartResponse(Protocol):
|
||||
self, status: str, headers: list[tuple[str, str]], exc_info: _OptExcInfo | None = ...
|
||||
) -> Callable[[bytes], Any]: ...
|
||||
|
||||
WSGIEnvironment = Dict[str, Any] # stable
|
||||
WSGIEnvironment = dict[str, Any] # stable
|
||||
WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] # stable
|
||||
|
||||
# WSGI input streams per PEP 3333, stable
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import SupportsWrite
|
||||
from typing import Any, Callable, Tuple, Type, TypeVar
|
||||
from typing import Any, Callable, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
|
||||
@@ -8,7 +8,7 @@ _FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
|
||||
# These definitions have special processing in mypy
|
||||
class ABCMeta(type):
|
||||
__abstractmethods__: frozenset[str]
|
||||
def __init__(self, name: str, bases: Tuple[type, ...], namespace: dict[str, Any]) -> None: ...
|
||||
def __init__(self, name: str, bases: tuple[type, ...], namespace: dict[str, Any]) -> None: ...
|
||||
def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ...
|
||||
def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ...
|
||||
def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = ...) -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, NamedTuple, Tuple, Type, Union, overload
|
||||
from typing import IO, Any, NamedTuple, Type, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
class Error(Exception): ...
|
||||
@@ -15,7 +15,7 @@ class _aifc_params(NamedTuple):
|
||||
compname: bytes
|
||||
|
||||
_File = Union[str, IO[bytes]]
|
||||
_Marker = Tuple[int, int, bytes]
|
||||
_Marker = tuple[int, int, bytes]
|
||||
|
||||
class Aifc_read:
|
||||
def __init__(self, f: _File) -> None: ...
|
||||
|
||||
@@ -1,20 +1,5 @@
|
||||
import sys
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
Callable,
|
||||
Generator,
|
||||
Generic,
|
||||
Iterable,
|
||||
NoReturn,
|
||||
Pattern,
|
||||
Protocol,
|
||||
Sequence,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from typing import IO, Any, Callable, Generator, Generic, Iterable, NoReturn, Pattern, Protocol, Sequence, Type, TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_ActionT = TypeVar("_ActionT", bound=Action)
|
||||
@@ -70,7 +55,7 @@ class _ActionsContainer:
|
||||
choices: Iterable[_T] | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
dest: str | None = ...,
|
||||
version: str = ...,
|
||||
**kwargs: Any,
|
||||
@@ -274,7 +259,7 @@ class HelpFormatter:
|
||||
def _format_text(self, text: str) -> str: ...
|
||||
def _format_action(self, action: Action) -> str: ...
|
||||
def _format_action_invocation(self, action: Action) -> str: ...
|
||||
def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], Tuple[str, ...]]: ...
|
||||
def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], tuple[str, ...]]: ...
|
||||
def _format_args(self, action: Action, default_metavar: str) -> str: ...
|
||||
def _expand_help(self, action: Action) -> str: ...
|
||||
def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
|
||||
@@ -299,7 +284,7 @@ class Action(_AttributeHolder):
|
||||
choices: Iterable[Any] | None
|
||||
required: bool
|
||||
help: str | None
|
||||
metavar: str | Tuple[str, ...] | None
|
||||
metavar: str | tuple[str, ...] | None
|
||||
def __init__(
|
||||
self,
|
||||
option_strings: Sequence[str],
|
||||
@@ -311,7 +296,7 @@ class Action(_AttributeHolder):
|
||||
choices: Iterable[_T] | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
def __call__(
|
||||
self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = ...
|
||||
@@ -330,7 +315,7 @@ if sys.version_info >= (3, 9):
|
||||
choices: Iterable[_T] | None = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
class Namespace(_AttributeHolder):
|
||||
@@ -375,7 +360,7 @@ class _StoreConstAction(Action):
|
||||
default: Any = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
@@ -403,7 +388,7 @@ class _AppendConstAction(Action):
|
||||
default: Any = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
|
||||
# undocumented
|
||||
@@ -440,7 +425,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
dest: str = ...,
|
||||
required: bool = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
@@ -450,7 +435,7 @@ class _SubParsersAction(Action, Generic[_ArgumentParserT]):
|
||||
parser_class: Type[_ArgumentParserT],
|
||||
dest: str = ...,
|
||||
help: str | None = ...,
|
||||
metavar: str | Tuple[str, ...] | None = ...,
|
||||
metavar: str | tuple[str, ...] | None = ...,
|
||||
) -> None: ...
|
||||
# TODO: Type keyword args properly.
|
||||
def add_parser(self, name: str, **kwargs: Any) -> _ArgumentParserT: ...
|
||||
|
||||
@@ -9,18 +9,18 @@ from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport
|
||||
from collections.abc import Iterable
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing import IO, Any, Awaitable, Callable, Generator, Sequence, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_Context = Dict[str, Any]
|
||||
_Context = dict[str, Any]
|
||||
_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any]
|
||||
_ProtocolFactory = Callable[[], BaseProtocol]
|
||||
_SSLContext = Union[bool, None, ssl.SSLContext]
|
||||
_TransProtPair = Tuple[BaseTransport, BaseProtocol]
|
||||
_TransProtPair = tuple[BaseTransport, BaseProtocol]
|
||||
|
||||
class Server(AbstractServer):
|
||||
if sys.version_info >= (3, 7):
|
||||
@@ -37,7 +37,7 @@ class Server(AbstractServer):
|
||||
def __init__(self, loop: AbstractEventLoop, sockets: list[socket]) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@property
|
||||
def sockets(self) -> Tuple[socket, ...]: ...
|
||||
def sockets(self) -> tuple[socket, ...]: ...
|
||||
elif sys.version_info >= (3, 7):
|
||||
@property
|
||||
def sockets(self) -> list[socket]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import subprocess
|
||||
from collections import deque
|
||||
from typing import IO, Any, Callable, Optional, Sequence, Tuple, Union
|
||||
from typing import IO, Any, Callable, Optional, Sequence, Union
|
||||
|
||||
from . import events, futures, protocols, transports
|
||||
|
||||
@@ -15,7 +15,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__(
|
||||
|
||||
@@ -3,7 +3,7 @@ import sys
|
||||
from _typeshed import FileDescriptorLike, Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Dict, Generator, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing import IO, Any, Awaitable, Callable, Generator, Sequence, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .base_events import Server
|
||||
@@ -17,11 +17,11 @@ if sys.version_info >= (3, 7):
|
||||
from contextvars import Context
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_Context = Dict[str, Any]
|
||||
_Context = dict[str, Any]
|
||||
_ExceptionHandler = Callable[[AbstractEventLoop, _Context], Any]
|
||||
_ProtocolFactory = Callable[[], BaseProtocol]
|
||||
_SSLContext = Union[bool, None, ssl.SSLContext]
|
||||
_TransProtPair = Tuple[BaseTransport, BaseProtocol]
|
||||
_TransProtPair = tuple[BaseTransport, BaseProtocol]
|
||||
|
||||
class Handle:
|
||||
_cancelled = False
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import socket
|
||||
import sys
|
||||
from types import TracebackType
|
||||
from typing import Any, BinaryIO, Iterable, NoReturn, Tuple, Type, Union, overload
|
||||
from typing import Any, BinaryIO, Iterable, NoReturn, Type, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
# These are based in socket, maybe move them out into _typeshed.pyi or such
|
||||
_Address = Union[Tuple[Any, ...], str]
|
||||
_Address = Union[tuple[Any, ...], str]
|
||||
_RetAddress = Any
|
||||
_WriteBuffer = Union[bytearray, memoryview]
|
||||
_CMSG = Tuple[int, int, bytes]
|
||||
_CMSG = tuple[int, int, bytes]
|
||||
class TransportSocket:
|
||||
def __init__(self, sock: socket.socket) -> None: ...
|
||||
def _na(self, what: str) -> None: ...
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike
|
||||
from socket import socket
|
||||
from typing import Any, Dict, Tuple, overload
|
||||
from typing import Any, overload
|
||||
|
||||
# cyclic dependence with asynchat
|
||||
_maptype = Dict[int, Any]
|
||||
_maptype = dict[int, Any]
|
||||
_socket = socket
|
||||
|
||||
socket_map: _maptype # undocumented
|
||||
@@ -41,8 +41,8 @@ class dispatcher:
|
||||
def readable(self) -> bool: ...
|
||||
def writable(self) -> bool: ...
|
||||
def listen(self, num: int) -> None: ...
|
||||
def bind(self, addr: Tuple[Any, ...] | str) -> None: ...
|
||||
def connect(self, address: Tuple[Any, ...] | str) -> 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 send(self, data: bytes) -> int: ...
|
||||
def recv(self, buffer_size: int) -> bytes: ...
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
from typing import Tuple
|
||||
|
||||
AdpcmState = Tuple[int, int]
|
||||
RatecvState = Tuple[int, Tuple[Tuple[int, int], ...]]
|
||||
AdpcmState = tuple[int, int]
|
||||
RatecvState = tuple[int, tuple[tuple[int, int], ...]]
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from types import CodeType, FrameType, TracebackType
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, Tuple, Type, TypeVar
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, Type, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
|
||||
_ExcInfo = Tuple[Type[BaseException], BaseException, FrameType]
|
||||
_ExcInfo = tuple[Type[BaseException], BaseException, FrameType]
|
||||
|
||||
GENERATOR_AND_COROUTINE_FLAGS: int
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import IO, Any, Tuple, Union
|
||||
from typing import IO, Any, Union
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
@@ -12,7 +12,7 @@ class FInfo:
|
||||
Creator: str
|
||||
Flags: int
|
||||
|
||||
_FileInfoTuple = Tuple[str, FInfo, int, int]
|
||||
_FileInfoTuple = tuple[str, FInfo, int, int]
|
||||
_FileHandleUnion = Union[str, IO[bytes]]
|
||||
|
||||
def getfileinfo(name: str) -> _FileInfoTuple: ...
|
||||
|
||||
@@ -49,7 +49,6 @@ from typing import (
|
||||
SupportsFloat,
|
||||
SupportsInt,
|
||||
SupportsRound,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
@@ -108,11 +107,11 @@ class object:
|
||||
def __sizeof__(self) -> int: ...
|
||||
# return type of pickle methods is rather hard to express in the current type system
|
||||
# see #6661 and https://docs.python.org/3/library/pickle.html#object.__reduce__
|
||||
def __reduce__(self) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce__(self) -> str | tuple[Any, ...]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reduce_ex__(self, __protocol: SupportsIndex) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce_ex__(self, __protocol: SupportsIndex) -> str | tuple[Any, ...]: ...
|
||||
else:
|
||||
def __reduce_ex__(self, __protocol: int) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce_ex__(self, __protocol: int) -> str | tuple[Any, ...]: ...
|
||||
def __dir__(self) -> Iterable[str]: ...
|
||||
def __init_subclass__(cls) -> None: ...
|
||||
|
||||
@@ -141,14 +140,14 @@ class classmethod(Generic[_R]): # Special, only valid as a decorator.
|
||||
|
||||
class type(object):
|
||||
__base__: type
|
||||
__bases__: Tuple[type, ...]
|
||||
__bases__: tuple[type, ...]
|
||||
__basicsize__: int
|
||||
__dict__: dict[str, Any]
|
||||
__dictoffset__: int
|
||||
__flags__: int
|
||||
__itemsize__: int
|
||||
__module__: str
|
||||
__mro__: Tuple[type, ...]
|
||||
__mro__: tuple[type, ...]
|
||||
__name__: str
|
||||
__qualname__: str
|
||||
__text_signature__: str | None
|
||||
@@ -156,11 +155,11 @@ class type(object):
|
||||
@overload
|
||||
def __init__(self, __o: object) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __name: str, __bases: Tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ...
|
||||
def __init__(self, __name: str, __bases: tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ...
|
||||
@overload
|
||||
def __new__(cls, __o: object) -> type: ...
|
||||
@overload
|
||||
def __new__(cls: Type[_TT], __name: str, __bases: Tuple[type, ...], __namespace: dict[str, Any], **kwds: Any) -> _TT: ...
|
||||
def __new__(cls: Type[_TT], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwds: Any) -> _TT: ...
|
||||
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
|
||||
def __subclasses__(self: _TT) -> list[_TT]: ...
|
||||
# Note: the documentation doesn't specify what the return type is, the standard
|
||||
@@ -169,7 +168,7 @@ class type(object):
|
||||
def __instancecheck__(self, __instance: Any) -> bool: ...
|
||||
def __subclasscheck__(self, __subclass: type) -> bool: ...
|
||||
@classmethod
|
||||
def __prepare__(metacls, __name: str, __bases: Tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ...
|
||||
def __prepare__(metacls, __name: str, __bases: tuple[type, ...], **kwds: Any) -> Mapping[str, object]: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, __t: Any) -> types.UnionType: ...
|
||||
def __ror__(self, __t: Any) -> types.UnionType: ...
|
||||
@@ -370,7 +369,7 @@ class str(Sequence[str]):
|
||||
def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
|
||||
def encode(self, encoding: str = ..., errors: str = ...) -> bytes: ...
|
||||
def endswith(
|
||||
self, __suffix: str | Tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> str: ...
|
||||
@@ -411,7 +410,7 @@ class str(Sequence[str]):
|
||||
def split(self, sep: str | None = ..., maxsplit: SupportsIndex = ...) -> list[str]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[str]: ...
|
||||
def startswith(
|
||||
self, __prefix: str | Tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
def strip(self, __chars: str | None = ...) -> str: ...
|
||||
def swapcase(self) -> str: ...
|
||||
@@ -463,7 +462,7 @@ class bytes(ByteString):
|
||||
) -> int: ...
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
|
||||
def endswith(
|
||||
self, __suffix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __suffix: bytes | tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytes: ...
|
||||
@@ -510,7 +509,7 @@ class bytes(ByteString):
|
||||
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytes]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[bytes]: ...
|
||||
def startswith(
|
||||
self, __prefix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __prefix: bytes | tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
def strip(self, __bytes: bytes | None = ...) -> bytes: ...
|
||||
def swapcase(self) -> bytes: ...
|
||||
@@ -565,7 +564,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def copy(self) -> bytearray: ...
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> str: ...
|
||||
def endswith(
|
||||
self, __suffix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __suffix: bytes | tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def expandtabs(self, tabsize: SupportsIndex = ...) -> bytearray: ...
|
||||
@@ -614,7 +613,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def split(self, sep: bytes | None = ..., maxsplit: SupportsIndex = ...) -> list[bytearray]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[bytearray]: ...
|
||||
def startswith(
|
||||
self, __prefix: bytes | Tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
self, __prefix: bytes | tuple[bytes, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
|
||||
) -> bool: ...
|
||||
def strip(self, __bytes: bytes | None = ...) -> bytearray: ...
|
||||
def swapcase(self) -> bytearray: ...
|
||||
@@ -659,9 +658,9 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
class memoryview(Sized, Sequence[int]):
|
||||
format: str
|
||||
itemsize: int
|
||||
shape: Tuple[int, ...] | None
|
||||
strides: Tuple[int, ...] | None
|
||||
suboffsets: Tuple[int, ...] | None
|
||||
shape: tuple[int, ...] | None
|
||||
strides: tuple[int, ...] | None
|
||||
suboffsets: tuple[int, ...] | None
|
||||
readonly: bool
|
||||
ndim: int
|
||||
|
||||
@@ -675,7 +674,7 @@ class memoryview(Sized, Sequence[int]):
|
||||
def __exit__(
|
||||
self, __exc_type: Type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
def cast(self, format: str, shape: list[int] | Tuple[int, ...] = ...) -> memoryview: ...
|
||||
def cast(self, format: str, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ...
|
||||
@overload
|
||||
def __getitem__(self, __i: SupportsIndex) -> int: ...
|
||||
@overload
|
||||
@@ -748,18 +747,18 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@overload
|
||||
def __getitem__(self, __x: SupportsIndex) -> _T_co: ...
|
||||
@overload
|
||||
def __getitem__(self, __x: slice) -> Tuple[_T_co, ...]: ...
|
||||
def __getitem__(self, __x: slice) -> tuple[_T_co, ...]: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __lt__(self, __x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __le__(self, __x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __gt__(self, __x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __ge__(self, __x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __lt__(self, __x: tuple[_T_co, ...]) -> bool: ...
|
||||
def __le__(self, __x: tuple[_T_co, ...]) -> bool: ...
|
||||
def __gt__(self, __x: tuple[_T_co, ...]) -> bool: ...
|
||||
def __ge__(self, __x: tuple[_T_co, ...]) -> bool: ...
|
||||
@overload
|
||||
def __add__(self, __x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
|
||||
def __add__(self, __x: tuple[_T_co, ...]) -> tuple[_T_co, ...]: ...
|
||||
@overload
|
||||
def __add__(self, __x: Tuple[_T, ...]) -> Tuple[_T_co | _T, ...]: ...
|
||||
def __mul__(self, __n: SupportsIndex) -> Tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, __n: SupportsIndex) -> Tuple[_T_co, ...]: ...
|
||||
def __add__(self, __x: tuple[_T, ...]) -> tuple[_T_co | _T, ...]: ...
|
||||
def __mul__(self, __n: SupportsIndex) -> tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, __n: SupportsIndex) -> tuple[_T_co, ...]: ...
|
||||
def count(self, __value: Any) -> int: ...
|
||||
def index(self, __value: Any, __start: SupportsIndex = ..., __stop: SupportsIndex = ...) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -924,7 +923,7 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
|
||||
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]: ...
|
||||
@@ -1090,15 +1089,15 @@ def iter(__function: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ...
|
||||
# We need recursive types to express the type of the second argument to `isinstance` properly, hence the use of `Any`
|
||||
if sys.version_info >= (3, 10):
|
||||
def isinstance(
|
||||
__obj: object, __class_or_tuple: type | types.UnionType | Tuple[type | types.UnionType | Tuple[Any, ...], ...]
|
||||
__obj: object, __class_or_tuple: type | types.UnionType | tuple[type | types.UnionType | tuple[Any, ...], ...]
|
||||
) -> bool: ...
|
||||
def issubclass(
|
||||
__cls: type, __class_or_tuple: type | types.UnionType | Tuple[type | types.UnionType | Tuple[Any, ...], ...]
|
||||
__cls: type, __class_or_tuple: type | types.UnionType | tuple[type | types.UnionType | tuple[Any, ...], ...]
|
||||
) -> bool: ...
|
||||
|
||||
else:
|
||||
def isinstance(__obj: object, __class_or_tuple: type | Tuple[type | Tuple[Any, ...], ...]) -> bool: ...
|
||||
def issubclass(__cls: type, __class_or_tuple: type | Tuple[type | Tuple[Any, ...], ...]) -> bool: ...
|
||||
def isinstance(__obj: object, __class_or_tuple: type | tuple[type | tuple[Any, ...], ...]) -> bool: ...
|
||||
def issubclass(__cls: type, __class_or_tuple: type | tuple[type | tuple[Any, ...], ...]) -> bool: ...
|
||||
|
||||
def len(__obj: Sized) -> int: ...
|
||||
def license() -> None: ...
|
||||
@@ -1449,7 +1448,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
strict: bool = ...,
|
||||
) -> zip[Tuple[Any, ...]]: ...
|
||||
) -> zip[tuple[Any, ...]]: ...
|
||||
else:
|
||||
@overload
|
||||
def __new__(cls, __iter1: Iterable[_T1]) -> zip[tuple[_T1]]: ...
|
||||
@@ -1480,7 +1479,7 @@ class zip(Iterator[_T_co], Generic[_T_co]):
|
||||
__iter5: Iterable[Any],
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> zip[Tuple[Any, ...]]: ...
|
||||
) -> zip[tuple[Any, ...]]: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
@@ -1502,7 +1501,7 @@ class ellipsis: ...
|
||||
Ellipsis: ellipsis
|
||||
|
||||
class BaseException(object):
|
||||
args: Tuple[Any, ...]
|
||||
args: tuple[Any, ...]
|
||||
__cause__: BaseException | None
|
||||
__context__: BaseException | None
|
||||
__suppress_context__: bool
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from types import CodeType
|
||||
from typing import Any, Callable, Tuple, TypeVar
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
|
||||
def runctx(
|
||||
@@ -9,7 +9,7 @@ def runctx(
|
||||
) -> None: ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_Label = Tuple[str, int, str]
|
||||
_Label = tuple[str, int, str]
|
||||
|
||||
class Profile:
|
||||
stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import datetime
|
||||
import sys
|
||||
from time import struct_time
|
||||
from typing import Any, Iterable, Optional, Sequence, Tuple
|
||||
from typing import Any, Iterable, Optional, Sequence
|
||||
|
||||
_LocaleType = Tuple[Optional[str], Optional[str]]
|
||||
_LocaleType = tuple[Optional[str], Optional[str]]
|
||||
|
||||
class IllegalMonthError(ValueError):
|
||||
def __init__(self, month: int) -> None: ...
|
||||
@@ -97,7 +97,7 @@ c: TextCalendar
|
||||
def setfirstweekday(firstweekday: int) -> None: ...
|
||||
def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
|
||||
def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
|
||||
def timegm(tuple: Tuple[int, ...] | struct_time) -> int: ...
|
||||
def timegm(tuple: tuple[int, ...] | struct_time) -> int: ...
|
||||
|
||||
# Data attributes
|
||||
day_name: Sequence[str]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from types import FrameType, TracebackType
|
||||
from typing import IO, Any, Callable, Optional, Tuple, Type
|
||||
from typing import IO, Any, Callable, Optional, Type
|
||||
|
||||
_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
_ExcInfo = tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
|
||||
def reset() -> str: ... # undocumented
|
||||
def small(text: str) -> str: ... # undocumented
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Tuple, Type, TypeVar, overload
|
||||
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
BOM32_BE: bytes
|
||||
@@ -71,7 +71,7 @@ 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
|
||||
|
||||
class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
|
||||
class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
|
||||
@property
|
||||
def encode(self) -> _Encoder: ...
|
||||
@property
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _collections_abc import dict_items, dict_keys, dict_values
|
||||
from _typeshed import Self, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT
|
||||
from typing import Any, Dict, Generic, NoReturn, Tuple, Type, TypeVar, overload
|
||||
from typing import Any, Generic, NoReturn, Type, TypeVar, overload
|
||||
from typing_extensions import SupportsIndex, final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -28,12 +28,12 @@ if sys.version_info >= (3, 7):
|
||||
rename: bool = ...,
|
||||
module: str | None = ...,
|
||||
defaults: Iterable[Any] | None = ...,
|
||||
) -> Type[Tuple[Any, ...]]: ...
|
||||
) -> Type[tuple[Any, ...]]: ...
|
||||
|
||||
else:
|
||||
def namedtuple(
|
||||
typename: str, field_names: str | Iterable[str], *, verbose: bool = ..., rename: bool = ..., module: str | None = ...
|
||||
) -> Type[Tuple[Any, ...]]: ...
|
||||
) -> Type[tuple[Any, ...]]: ...
|
||||
|
||||
class UserDict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
data: dict[_KT, _VT]
|
||||
@@ -132,7 +132,7 @@ class UserString(Sequence[str]):
|
||||
def encode(self: UserString, encoding: str | None = ..., errors: str | None = ...) -> bytes: ...
|
||||
else:
|
||||
def encode(self: _UserStringT, encoding: str | None = ..., errors: str | None = ...) -> _UserStringT: ...
|
||||
def endswith(self, suffix: str | Tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
|
||||
def endswith(self, suffix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
|
||||
def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ...
|
||||
def find(self, sub: str | UserString, start: int = ..., end: int = ...) -> int: ...
|
||||
def format(self, *args: Any, **kwds: Any) -> str: ...
|
||||
@@ -174,7 +174,7 @@ class UserString(Sequence[str]):
|
||||
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[str]: ...
|
||||
def startswith(self, prefix: str | Tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
|
||||
def startswith(self, prefix: str | tuple[str, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
|
||||
def strip(self: _UserStringT, chars: str | None = ...) -> _UserStringT: ...
|
||||
def swapcase(self: _UserStringT) -> _UserStringT: ...
|
||||
def title(self: _UserStringT) -> _UserStringT: ...
|
||||
@@ -214,7 +214,7 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
class Counter(Dict[_T, int], Generic[_T]):
|
||||
class Counter(dict[_T, int], Generic[_T]):
|
||||
@overload
|
||||
def __init__(self, __iterable: None = ..., **kwargs: int) -> None: ...
|
||||
@overload
|
||||
@@ -261,14 +261,14 @@ class _OrderedDictKeysView(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # ty
|
||||
def __reversed__(self) -> Iterator[_KT_co]: ...
|
||||
|
||||
@final
|
||||
class _OrderedDictItemsView(dict_items[_KT_co, _VT_co], Reversible[Tuple[_KT_co, _VT_co]]): # type: ignore[misc]
|
||||
class _OrderedDictItemsView(dict_items[_KT_co, _VT_co], Reversible[tuple[_KT_co, _VT_co]]): # type: ignore[misc]
|
||||
def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ...
|
||||
|
||||
@final
|
||||
class _OrderedDictValuesView(dict_values[_KT_co, _VT_co], Reversible[_VT_co], Generic[_KT_co, _VT_co]): # type: ignore[misc]
|
||||
def __reversed__(self) -> Iterator[_VT_co]: ...
|
||||
|
||||
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
||||
def copy(self: Self) -> Self: ...
|
||||
@@ -286,7 +286,7 @@ class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> OrderedDict[_T, _S]: ...
|
||||
|
||||
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
default_factory: Callable[[], _VT] | None
|
||||
@overload
|
||||
def __init__(self, **kwargs: _VT) -> None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Container, Iterable, Iterator, Sequence
|
||||
from logging import Logger
|
||||
from typing import Any, Callable, Generic, Protocol, Set, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Protocol, TypeVar, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -76,7 +76,7 @@ class Executor:
|
||||
def as_completed(fs: Iterable[Future[_T]], timeout: float | None = ...) -> Iterator[Future[_T]]: ...
|
||||
|
||||
# Ideally this would be a namedtuple, but mypy doesn't support generic tuple types. See #1976
|
||||
class DoneAndNotDoneFutures(Sequence[Set[Future[_T]]]):
|
||||
class DoneAndNotDoneFutures(Sequence[set[Future[_T]]]):
|
||||
done: set[Future[_T]]
|
||||
not_done: set[Future[_T]]
|
||||
def __new__(_cls, done: set[Future[_T]], not_done: set[Future[_T]]) -> DoneAndNotDoneFutures[_T]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from multiprocessing.context import BaseContext, Process
|
||||
from multiprocessing.queues import Queue, SimpleQueue
|
||||
from threading import Lock, Semaphore, Thread
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Generic, Tuple, TypeVar
|
||||
from typing import Any, Callable, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
@@ -37,7 +37,7 @@ class _ExceptionWithTraceback:
|
||||
exc: BaseException
|
||||
tb: TracebackType
|
||||
def __init__(self, exc: BaseException, tb: TracebackType) -> None: ...
|
||||
def __reduce__(self) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce__(self) -> str | tuple[Any, ...]: ...
|
||||
|
||||
def _rebuild_exc(exc: Exception, tb: str) -> Exception: ...
|
||||
|
||||
@@ -84,7 +84,7 @@ if sys.version_info >= (3, 7):
|
||||
) -> None: ...
|
||||
def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ...
|
||||
|
||||
def _get_chunks(*iterables: Any, chunksize: int) -> Generator[Tuple[Any, ...], None, 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 _sendback_result(
|
||||
result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = ..., exception: Exception | None = ...
|
||||
@@ -95,7 +95,7 @@ if sys.version_info >= (3, 7):
|
||||
call_queue: Queue[_CallItem],
|
||||
result_queue: SimpleQueue[_ResultItem],
|
||||
initializer: Callable[..., None] | None,
|
||||
initargs: Tuple[Any, ...],
|
||||
initargs: tuple[Any, ...],
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
@@ -139,7 +139,7 @@ else:
|
||||
class ProcessPoolExecutor(Executor):
|
||||
_mp_context: BaseContext | None = ...
|
||||
_initializer: Callable[..., None] | None = ...
|
||||
_initargs: Tuple[Any, ...] = ...
|
||||
_initargs: tuple[Any, ...] = ...
|
||||
_executor_manager_thread: _ThreadWakeup
|
||||
_processes: MutableMapping[int, Process]
|
||||
_shutdown_thread: bool
|
||||
@@ -158,7 +158,7 @@ class ProcessPoolExecutor(Executor):
|
||||
max_workers: int | None = ...,
|
||||
mp_context: BaseContext | None = ...,
|
||||
initializer: Callable[..., None] | None = ...,
|
||||
initargs: Tuple[Any, ...] = ...,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, max_workers: int | None = ...) -> None: ...
|
||||
|
||||
@@ -2,7 +2,7 @@ import queue
|
||||
import sys
|
||||
from collections.abc import Iterable, Mapping, Set as AbstractSet
|
||||
from threading import Lock, Semaphore, Thread
|
||||
from typing import Any, Callable, Generic, Tuple, TypeVar
|
||||
from typing import Any, Callable, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
@@ -33,7 +33,7 @@ if sys.version_info >= (3, 7):
|
||||
executor_reference: ref[Any],
|
||||
work_queue: queue.SimpleQueue[Any],
|
||||
initializer: Callable[..., None],
|
||||
initargs: Tuple[Any, ...],
|
||||
initargs: tuple[Any, ...],
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
@@ -52,7 +52,7 @@ class ThreadPoolExecutor(Executor):
|
||||
_shutdown_lock: Lock
|
||||
_thread_name_prefix: str | None = ...
|
||||
_initializer: Callable[..., None] | None = ...
|
||||
_initargs: Tuple[Any, ...] = ...
|
||||
_initargs: tuple[Any, ...] = ...
|
||||
if sys.version_info >= (3, 7):
|
||||
_work_queue: queue.SimpleQueue[_WorkItem[Any]]
|
||||
else:
|
||||
@@ -63,7 +63,7 @@ class ThreadPoolExecutor(Executor):
|
||||
max_workers: int | None = ...,
|
||||
thread_name_prefix: str = ...,
|
||||
initializer: Callable[..., None] | None = ...,
|
||||
initargs: Tuple[Any, ...] = ...,
|
||||
initargs: tuple[Any, ...] = ...,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(self, max_workers: int | None = ..., thread_name_prefix: str = ...) -> None: ...
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
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, Type, TypeVar, overload
|
||||
from typing import Any, ClassVar, Optional, Pattern, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
# Internal type aliases
|
||||
_section = Mapping[str, str]
|
||||
_parser = MutableMapping[str, _section]
|
||||
_converter = Callable[[str], Any]
|
||||
_converters = Dict[str, _converter]
|
||||
_converters = dict[str, _converter]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Callable, Hashable, Optional, SupportsInt, Tuple, TypeVar, Union
|
||||
from typing import Any, Callable, Hashable, Optional, SupportsInt, TypeVar, Union
|
||||
|
||||
_TypeT = TypeVar("_TypeT", bound=type)
|
||||
_Reduce = Union[Tuple[Callable[..., _TypeT], Tuple[Any, ...]], Tuple[Callable[..., _TypeT], Tuple[Any, ...], Optional[Any]]]
|
||||
_Reduce = Union[tuple[Callable[..., _TypeT], tuple[Any, ...]], tuple[Callable[..., _TypeT], tuple[Any, ...], Optional[Any]]]
|
||||
|
||||
__all__: list[str]
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
|
||||
from typing import Any, Generic, Type, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Dict as _DictReadMapping
|
||||
from builtins import dict as _DictReadMapping
|
||||
else:
|
||||
from collections import OrderedDict as _DictReadMapping
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ from typing import (
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union as _UnionT,
|
||||
@@ -98,8 +97,8 @@ class _CData(metaclass=_CDataMeta):
|
||||
class _CanCastTo(_CData): ...
|
||||
class _PointerLike(_CanCastTo): ...
|
||||
|
||||
_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CData]
|
||||
_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]]
|
||||
_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, tuple[_CData, ...]], _CData]
|
||||
_PF = _UnionT[tuple[int], tuple[int, str], tuple[int, str, Any]]
|
||||
|
||||
class _FuncPointer(_PointerLike, _CData):
|
||||
restype: Type[_CData] | Callable[[int], Any] | None
|
||||
@@ -110,9 +109,9 @@ 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 __init__(self, vtlb_index: int, name: str, paramflags: tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
class _NamedFuncPointer(_FuncPointer):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
import types
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, Tuple, Type, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, Type, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -20,7 +20,7 @@ def asdict(obj: Any) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ...
|
||||
@overload
|
||||
def astuple(obj: Any) -> Tuple[Any, ...]: ...
|
||||
def astuple(obj: Any) -> tuple[Any, ...]: ...
|
||||
@overload
|
||||
def astuple(obj: Any, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ...
|
||||
|
||||
@@ -172,7 +172,7 @@ else:
|
||||
metadata: Mapping[Any, Any] | None = ...,
|
||||
) -> Any: ...
|
||||
|
||||
def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ...
|
||||
def fields(class_or_instance: Any) -> tuple[Field[Any], ...]: ...
|
||||
def is_dataclass(obj: Any) -> bool: ...
|
||||
|
||||
class FrozenInstanceError(AttributeError): ...
|
||||
@@ -191,7 +191,7 @@ if sys.version_info >= (3, 10):
|
||||
cls_name: str,
|
||||
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
|
||||
*,
|
||||
bases: Tuple[type, ...] = ...,
|
||||
bases: tuple[type, ...] = ...,
|
||||
namespace: dict[str, Any] | None = ...,
|
||||
init: bool = ...,
|
||||
repr: bool = ...,
|
||||
@@ -209,7 +209,7 @@ else:
|
||||
cls_name: str,
|
||||
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
|
||||
*,
|
||||
bases: Tuple[type, ...] = ...,
|
||||
bases: tuple[type, ...] = ...,
|
||||
namespace: dict[str, Any] | None = ...,
|
||||
init: bool = ...,
|
||||
repr: bool = ...,
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import numbers
|
||||
import sys
|
||||
from types import TracebackType
|
||||
from typing import Any, Container, NamedTuple, Sequence, Tuple, Type, TypeVar, Union, overload
|
||||
from typing import Any, Container, NamedTuple, Sequence, Type, TypeVar, Union, overload
|
||||
|
||||
_Decimal = Union[Decimal, int]
|
||||
_DecimalNew = Union[Decimal, float, str, Tuple[int, Sequence[int], int]]
|
||||
_DecimalNew = Union[Decimal, float, str, tuple[int, Sequence[int], int]]
|
||||
_ComparableNum = Union[Decimal, float, numbers.Rational]
|
||||
_DecimalT = TypeVar("_DecimalT", bound=Decimal)
|
||||
|
||||
class DecimalTuple(NamedTuple):
|
||||
sign: int
|
||||
digits: Tuple[int, ...]
|
||||
digits: tuple[int, ...]
|
||||
exponent: int
|
||||
|
||||
ROUND_DOWN: str
|
||||
@@ -184,7 +184,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: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Callable, Optional, Tuple, Union
|
||||
from typing import Any, Callable, Optional, Union
|
||||
|
||||
_Macro = Union[Tuple[str], Tuple[str, Optional[str]]]
|
||||
_Macro = Union[tuple[str], tuple[str, Optional[str]]]
|
||||
|
||||
def gen_lib_options(
|
||||
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
|
||||
@@ -141,7 +141,7 @@ class CCompiler:
|
||||
def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ...
|
||||
def object_filenames(self, source_filenames: list[str], strip_dir: int = ..., output_dir: str = ...) -> list[str]: ...
|
||||
def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
|
||||
def execute(self, func: Callable[..., None], args: Tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
|
||||
def execute(self, func: Callable[..., None], args: tuple[Any, ...], msg: str | None = ..., level: int = ...) -> None: ...
|
||||
def spawn(self, cmd: list[str]) -> None: ...
|
||||
def mkpath(self, name: str, mode: int = ...) -> None: ...
|
||||
def move_file(self, src: str, dst: str) -> str: ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
|
||||
from ..cmd import Command
|
||||
|
||||
HAS_USER_SITE: bool
|
||||
SCHEME_KEYS: Tuple[str, ...]
|
||||
SCHEME_KEYS: tuple[str, ...]
|
||||
INSTALL_SCHEMES: dict[str, dict[Any, Any]]
|
||||
|
||||
class install(Command):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Iterable, List, Mapping, Optional, Tuple, overload
|
||||
from typing import Any, Iterable, Mapping, Optional, overload
|
||||
|
||||
_Option = Tuple[str, Optional[str], str]
|
||||
_GR = Tuple[List[str], OptionDummy]
|
||||
_Option = tuple[str, Optional[str], str]
|
||||
_GR = tuple[list[str], OptionDummy]
|
||||
|
||||
def fancy_getopt(
|
||||
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Callable, Container, Iterable, Mapping
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
|
||||
def get_platform() -> str: ...
|
||||
def convert_path(pathname: str) -> str: ...
|
||||
@@ -9,7 +9,7 @@ def check_environ() -> None: ...
|
||||
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
|
||||
def split_quoted(s: str) -> list[str]: ...
|
||||
def execute(
|
||||
func: Callable[..., None], args: Tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
|
||||
func: Callable[..., None], args: tuple[Any, ...], msg: str | None = ..., verbose: bool = ..., dry_run: bool = ...
|
||||
) -> None: ...
|
||||
def strtobool(val: str) -> bool: ...
|
||||
def byte_compile(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from abc import abstractmethod
|
||||
from typing import Pattern, Tuple, TypeVar
|
||||
from typing import Pattern, TypeVar
|
||||
|
||||
_T = TypeVar("_T", bound=Version)
|
||||
|
||||
@@ -31,7 +31,7 @@ class StrictVersion(Version):
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: Tuple[str | int, ...]
|
||||
version: tuple[str | int, ...]
|
||||
def __init__(self, vstring: str | None = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import types
|
||||
import unittest
|
||||
from typing import Any, Callable, NamedTuple, Tuple, Type
|
||||
from typing import Any, Callable, NamedTuple, Type
|
||||
|
||||
class TestResults(NamedTuple):
|
||||
failed: int
|
||||
@@ -86,7 +86,7 @@ class DocTestFinder:
|
||||
) -> list[DocTest]: ...
|
||||
|
||||
_Out = Callable[[str], Any]
|
||||
_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType]
|
||||
_ExcInfo = tuple[Type[BaseException], BaseException, types.TracebackType]
|
||||
|
||||
class DocTestRunner:
|
||||
DIVIDER: str
|
||||
|
||||
@@ -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, Type, TypeVar, Union
|
||||
from typing import Any, Iterable, Iterator, Pattern, Type, TypeVar, Union
|
||||
from typing_extensions import Final
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -23,7 +23,7 @@ def quote_string(value: Any) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
rfc2047_matcher: Pattern[str]
|
||||
|
||||
class TokenList(List[Union[TokenList, Terminal]]):
|
||||
class TokenList(list[Union[TokenList, Terminal]]):
|
||||
token_type: str | None
|
||||
syntactic_break: bool
|
||||
ew_combine_allowed: bool
|
||||
|
||||
@@ -13,7 +13,7 @@ from email._header_value_parser import (
|
||||
)
|
||||
from email.errors import MessageDefect
|
||||
from email.policy import Policy
|
||||
from typing import Any, ClassVar, Tuple, Type
|
||||
from typing import Any, ClassVar, Type
|
||||
from typing_extensions import Literal
|
||||
|
||||
class BaseHeader(str):
|
||||
@@ -22,7 +22,7 @@ class BaseHeader(str):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@property
|
||||
def defects(self) -> Tuple[MessageDefect, ...]: ...
|
||||
def defects(self) -> tuple[MessageDefect, ...]: ...
|
||||
def __new__(cls, name: str, value: Any) -> BaseHeader: ...
|
||||
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
@@ -54,9 +54,9 @@ class AddressHeader:
|
||||
max_count: ClassVar[Literal[1] | None]
|
||||
def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], groups: Iterable[Group]) -> None: ...
|
||||
@property
|
||||
def groups(self) -> Tuple[Group, ...]: ...
|
||||
def groups(self) -> tuple[Group, ...]: ...
|
||||
@property
|
||||
def addresses(self) -> Tuple[Address, ...]: ...
|
||||
def addresses(self) -> tuple[Address, ...]: ...
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> AddressList: ...
|
||||
@classmethod
|
||||
@@ -165,6 +165,6 @@ class Group:
|
||||
@property
|
||||
def display_name(self) -> str | None: ...
|
||||
@property
|
||||
def addresses(self) -> Tuple[Address, ...]: ...
|
||||
def addresses(self) -> tuple[Address, ...]: ...
|
||||
def __init__(self, display_name: str | None = ..., addresses: Iterable[Address] | None = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
@@ -2,14 +2,14 @@ from email.charset import Charset
|
||||
from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.policy import Policy
|
||||
from typing import Any, Generator, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union
|
||||
from typing import Any, Generator, Iterator, Optional, Sequence, TypeVar, Union
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
_PayloadType = Union[List[Message], str, bytes]
|
||||
_PayloadType = Union[list[Message], str, bytes]
|
||||
_CharsetType = Union[Charset, str, None]
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
_ParamType = Union[str, tuple[Optional[str], Optional[str], str]]
|
||||
_HeaderType = Any
|
||||
|
||||
class Message:
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
from email.policy import Policy
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
from typing import Callable, Optional, Union
|
||||
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
|
||||
class MIMEApplication(MIMENonMultipart):
|
||||
def __init__(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
from email.policy import Policy
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
from typing import Callable, Optional, Union
|
||||
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
|
||||
class MIMEAudio(MIMENonMultipart):
|
||||
def __init__(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import email.message
|
||||
from email.policy import Policy
|
||||
from typing import Optional, Tuple, Union
|
||||
from typing import Optional, Union
|
||||
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
|
||||
class MIMEBase(email.message.Message):
|
||||
def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = ..., **_params: _ParamsType) -> None: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from email.mime.nonmultipart import MIMENonMultipart
|
||||
from email.policy import Policy
|
||||
from typing import Callable, Optional, Tuple, Union
|
||||
from typing import Callable, Optional, Union
|
||||
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
|
||||
class MIMEImage(MIMENonMultipart):
|
||||
def __init__(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from email.message import Message
|
||||
from email.mime.base import MIMEBase
|
||||
from email.policy import Policy
|
||||
from typing import Optional, Sequence, Tuple, Union
|
||||
from typing import Optional, Sequence, Union
|
||||
|
||||
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
|
||||
_ParamsType = Union[str, None, tuple[str, Optional[str], str]]
|
||||
|
||||
class MIMEMultipart(MIMEBase):
|
||||
def __init__(
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import datetime
|
||||
import sys
|
||||
from email.charset import Charset
|
||||
from typing import Optional, Tuple, Union, overload
|
||||
from typing import Optional, Union, overload
|
||||
|
||||
_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
|
||||
_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
|
||||
_ParamType = Union[str, tuple[Optional[str], Optional[str], str]]
|
||||
_PDTZ = tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
|
||||
|
||||
def quote(str: str) -> str: ...
|
||||
def unquote(str: str) -> str: ...
|
||||
|
||||
@@ -3,7 +3,7 @@ import types
|
||||
from abc import ABCMeta
|
||||
from builtins import property as _builtins_property
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
from typing import Any, Dict, Tuple, Type, TypeVar, Union, overload
|
||||
from typing import Any, Type, TypeVar, Union, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_S = TypeVar("_S", bound=Type[Enum])
|
||||
@@ -21,7 +21,7 @@ _S = TypeVar("_S", bound=Type[Enum])
|
||||
# <enum 'Foo'>
|
||||
_EnumNames = Union[str, Iterable[str], Iterable[Iterable[Union[str, Any]]], Mapping[str, Any]]
|
||||
|
||||
class _EnumDict(Dict[str, Any]):
|
||||
class _EnumDict(dict[str, Any]):
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
# Note: EnumMeta actually subclasses type directly, not ABCMeta.
|
||||
@@ -34,7 +34,7 @@ class EnumMeta(ABCMeta):
|
||||
def __new__(
|
||||
metacls: Type[_T],
|
||||
cls: str,
|
||||
bases: Tuple[type, ...],
|
||||
bases: tuple[type, ...],
|
||||
classdict: _EnumDict,
|
||||
*,
|
||||
boundary: FlagBoundary | None = ...,
|
||||
@@ -42,9 +42,9 @@ class EnumMeta(ABCMeta):
|
||||
**kwds: Any,
|
||||
) -> _T: ...
|
||||
elif sys.version_info >= (3, 9):
|
||||
def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> _T: ... # type: ignore
|
||||
def __new__(metacls: Type[_T], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> _T: ... # type: ignore
|
||||
else:
|
||||
def __new__(metacls: Type[_T], cls: str, bases: Tuple[type, ...], classdict: _EnumDict) -> _T: ... # type: ignore
|
||||
def __new__(metacls: Type[_T], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> _T: ... # type: ignore
|
||||
def __iter__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __reversed__(self: Type[_T]) -> Iterator[_T]: ...
|
||||
def __contains__(self: Type[Any], member: object) -> bool: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import IO, Any, Iterable, Tuple
|
||||
from typing import IO, Any, Iterable
|
||||
|
||||
AS_IS: None
|
||||
_FontType = Tuple[str, bool, bool, bool]
|
||||
_StylesType = Tuple[Any, ...]
|
||||
_FontType = tuple[str, bool, bool, bool]
|
||||
_StylesType = tuple[Any, ...]
|
||||
|
||||
class NullFormatter:
|
||||
writer: NullWriter | None
|
||||
@@ -68,7 +68,7 @@ class NullWriter:
|
||||
def new_font(self, font: _FontType) -> None: ...
|
||||
def new_margin(self, margin: int, level: int) -> None: ...
|
||||
def new_spacing(self, spacing: str | None) -> None: ...
|
||||
def new_styles(self, styles: Tuple[Any, ...]) -> None: ...
|
||||
def new_styles(self, styles: tuple[Any, ...]) -> None: ...
|
||||
def send_paragraph(self, blankline: int) -> None: ...
|
||||
def send_line_break(self) -> None: ...
|
||||
def send_hor_rule(self, *args: Any, **kw: Any) -> None: ...
|
||||
@@ -81,7 +81,7 @@ class AbstractWriter(NullWriter):
|
||||
def new_font(self, font: _FontType) -> None: ...
|
||||
def new_margin(self, margin: int, level: int) -> None: ...
|
||||
def new_spacing(self, spacing: str | None) -> None: ...
|
||||
def new_styles(self, styles: Tuple[Any, ...]) -> None: ...
|
||||
def new_styles(self, styles: tuple[Any, ...]) -> None: ...
|
||||
def send_paragraph(self, blankline: int) -> None: ...
|
||||
def send_line_break(self) -> None: ...
|
||||
def send_hor_rule(self, *args: Any, **kw: Any) -> None: ...
|
||||
|
||||
@@ -3,7 +3,7 @@ from _typeshed import Self, SupportsRead, SupportsReadline
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Iterable, Iterator, TextIO, Tuple, Type
|
||||
from typing import Any, Callable, Iterable, Iterator, TextIO, Type
|
||||
from typing_extensions import Literal
|
||||
|
||||
MSG_OOB: int
|
||||
@@ -18,7 +18,7 @@ class error_temp(Error): ...
|
||||
class error_perm(Error): ...
|
||||
class error_proto(Error): ...
|
||||
|
||||
all_errors: Tuple[Type[Exception], ...]
|
||||
all_errors: tuple[Type[Exception], ...]
|
||||
|
||||
class FTP:
|
||||
debugging: int
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import SupportsAllComparisons, SupportsItems
|
||||
from typing import Any, Callable, Generic, Hashable, Iterable, NamedTuple, Sequence, Sized, Tuple, Type, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Hashable, Iterable, NamedTuple, Sequence, Sized, Type, TypeVar, overload
|
||||
from typing_extensions import final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -49,7 +49,7 @@ def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComp
|
||||
|
||||
class partial(Generic[_T]):
|
||||
func: Callable[..., _T]
|
||||
args: Tuple[Any, ...]
|
||||
args: tuple[Any, ...]
|
||||
keywords: dict[str, Any]
|
||||
def __init__(self, func: Callable[..., _T], *args: Any, **kwargs: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
@@ -61,7 +61,7 @@ _Descriptor = Any
|
||||
|
||||
class partialmethod(Generic[_T]):
|
||||
func: Callable[..., _T] | _Descriptor
|
||||
args: Tuple[Any, ...]
|
||||
args: tuple[Any, ...]
|
||||
keywords: dict[str, Any]
|
||||
@overload
|
||||
def __init__(self, __func: Callable[..., _T], *args: Any, **keywords: Any) -> None: ...
|
||||
@@ -120,10 +120,10 @@ if sys.version_info >= (3, 9):
|
||||
def cache(__user_function: Callable[..., _T]) -> _lru_cache_wrapper[_T]: ...
|
||||
|
||||
def _make_key(
|
||||
args: Tuple[Hashable, ...],
|
||||
args: tuple[Hashable, ...],
|
||||
kwds: SupportsItems[Any, Any],
|
||||
typed: bool,
|
||||
kwd_mark: Tuple[object, ...] = ...,
|
||||
kwd_mark: tuple[object, ...] = ...,
|
||||
fasttypes: set[type] = ...,
|
||||
tuple: type = ...,
|
||||
type: Any = ...,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
|
||||
from typing import Sequence, Tuple, overload
|
||||
from typing import Sequence, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
# All overloads can return empty string. Ideally, Literal[""] would be a valid
|
||||
@@ -13,7 +13,7 @@ def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[Tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ...
|
||||
def commonprefix(m: Sequence[tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ...
|
||||
def exists(path: StrOrBytesPath | int) -> bool: ...
|
||||
def getsize(filename: StrOrBytesPath | int) -> int: ...
|
||||
def isfile(path: StrOrBytesPath | int) -> bool: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import SupportsItems
|
||||
from typing import Generic, Iterable, Tuple, TypeVar
|
||||
from typing import Generic, Iterable, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -10,7 +10,7 @@ class TopologicalSorter(Generic[_T]):
|
||||
def is_active(self) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def done(self, *nodes: _T) -> None: ...
|
||||
def get_ready(self) -> Tuple[_T, ...]: ...
|
||||
def get_ready(self) -> tuple[_T, ...]: ...
|
||||
def static_order(self) -> Iterable[_T]: ...
|
||||
|
||||
class CycleError(ValueError): ...
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from _typeshed import structseq
|
||||
from typing import Any, List, Optional, Tuple
|
||||
from typing import Any, Optional
|
||||
from typing_extensions import final
|
||||
|
||||
@final
|
||||
class struct_group(structseq[Any], Tuple[str, Optional[str], int, List[str]]):
|
||||
class struct_group(structseq[Any], tuple[str, Optional[str], int, list[str]]):
|
||||
@property
|
||||
def gr_name(self) -> str: ...
|
||||
@property
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _markupbase import ParserBase
|
||||
from typing import Pattern, Tuple
|
||||
from typing import Pattern
|
||||
|
||||
class HTMLParser(ParserBase):
|
||||
def __init__(self, *, convert_charrefs: bool = ...) -> None: ...
|
||||
@@ -18,7 +18,7 @@ class HTMLParser(ParserBase):
|
||||
def handle_decl(self, decl: str) -> None: ...
|
||||
def handle_pi(self, data: str) -> None: ...
|
||||
def unknown_decl(self, data: str) -> None: ...
|
||||
CDATA_CONTENT_ELEMENTS: Tuple[str, ...]
|
||||
CDATA_CONTENT_ELEMENTS: tuple[str, ...]
|
||||
def check_for_whole_start_tag(self, i: int) -> int: ... # undocumented
|
||||
def clear_cdata_mode(self) -> None: ... # undocumented
|
||||
def goahead(self, end: bool) -> None: ... # undocumented
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from http.client import HTTPResponse
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, Tuple, TypeVar, overload
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, TypeVar, overload
|
||||
from urllib.request import Request
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -102,10 +102,10 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
strict_ns_set_initial_dollar: bool = ...,
|
||||
strict_ns_set_path: bool = ...,
|
||||
) -> None: ...
|
||||
def blocked_domains(self) -> Tuple[str, ...]: ...
|
||||
def blocked_domains(self) -> tuple[str, ...]: ...
|
||||
def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ...
|
||||
def is_blocked(self, domain: str) -> bool: ...
|
||||
def allowed_domains(self) -> Tuple[str, ...] | None: ...
|
||||
def allowed_domains(self) -> tuple[str, ...] | None: ...
|
||||
def set_allowed_domains(self, allowed_domains: Sequence[str] | None) -> None: ...
|
||||
def is_not_allowed(self, domain: str) -> bool: ...
|
||||
def set_ok_version(self, cookie: Cookie, request: Request) -> bool: ... # undocumented
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Dict, Generic, Iterable, Mapping, TypeVar, Union, overload
|
||||
from typing import Any, Generic, Iterable, Mapping, TypeVar, Union, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -18,7 +18,7 @@ def _unquote(str: str) -> str: ...
|
||||
|
||||
class CookieError(Exception): ...
|
||||
|
||||
class Morsel(Dict[str, Any], Generic[_T]):
|
||||
class Morsel(dict[str, Any], Generic[_T]):
|
||||
value: str
|
||||
coded_value: _T
|
||||
key: str
|
||||
@@ -40,7 +40,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class BaseCookie(Dict[str, Morsel[_T]], Generic[_T]):
|
||||
class BaseCookie(dict[str, Morsel[_T]], Generic[_T]):
|
||||
def __init__(self, input: _DataType | None = ...) -> None: ...
|
||||
def value_decode(self, val: str) -> _T: ...
|
||||
def value_encode(self, val: _T) -> str: ...
|
||||
|
||||
@@ -5,14 +5,14 @@ from _typeshed import Self
|
||||
from socket import socket as _socket
|
||||
from ssl import SSLContext, SSLSocket
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, Callable, List, Pattern, Tuple, Type, Union
|
||||
from typing import IO, Any, Callable, Pattern, Type, Union
|
||||
from typing_extensions import Literal
|
||||
|
||||
# TODO: Commands should use their actual return types, not this type alias.
|
||||
# E.g. Tuple[Literal["OK"], List[bytes]]
|
||||
_CommandResults = Tuple[str, List[Any]]
|
||||
_CommandResults = tuple[str, list[Any]]
|
||||
|
||||
_AnyResponseData = Union[List[None], List[Union[bytes, Tuple[bytes, bytes]]]]
|
||||
_AnyResponseData = Union[list[None], list[Union[bytes, tuple[bytes, bytes]]]]
|
||||
|
||||
_list = list # conflicts with a method named "list"
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from email.message import Message
|
||||
from importlib.abc import MetaPathFinder
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Any, ClassVar, Iterable, NamedTuple, Pattern, Tuple, overload
|
||||
from typing import Any, ClassVar, Iterable, NamedTuple, Pattern, overload
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
from importlib.metadata._meta import PackageMetadata as PackageMetadata
|
||||
@@ -101,6 +101,6 @@ if sys.version_info >= (3, 8):
|
||||
) -> Iterable[Distribution]: ...
|
||||
def metadata(distribution_name: str) -> Message: ...
|
||||
def version(distribution_name: str) -> str: ...
|
||||
def entry_points() -> dict[str, Tuple[EntryPoint, ...]]: ...
|
||||
def entry_points() -> dict[str, tuple[EntryPoint, ...]]: ...
|
||||
def files(distribution_name: str) -> list[PackagePath] | None: ...
|
||||
def requires(distribution_name: str) -> list[str] | None: ...
|
||||
|
||||
@@ -23,7 +23,7 @@ from types import (
|
||||
if sys.version_info >= (3, 7):
|
||||
from types import ClassMethodDescriptorType, WrapperDescriptorType, MemberDescriptorType, MethodDescriptorType
|
||||
|
||||
from typing import Any, ClassVar, NamedTuple, Protocol, Tuple, Type, TypeVar, Union
|
||||
from typing import Any, ClassVar, NamedTuple, Protocol, Type, TypeVar, Union
|
||||
from typing_extensions import Literal, TypeGuard
|
||||
|
||||
#
|
||||
@@ -234,7 +234,7 @@ class Parameter:
|
||||
|
||||
class BoundArguments:
|
||||
arguments: OrderedDict[str, Any]
|
||||
args: Tuple[Any, ...]
|
||||
args: tuple[Any, ...]
|
||||
kwargs: dict[str, Any]
|
||||
signature: Signature
|
||||
def __init__(self, signature: Signature, arguments: OrderedDict[str, Any]) -> None: ...
|
||||
@@ -262,14 +262,14 @@ if sys.version_info < (3, 11):
|
||||
args: list[str]
|
||||
varargs: str | None
|
||||
keywords: str | None
|
||||
defaults: Tuple[Any, ...]
|
||||
defaults: tuple[Any, ...]
|
||||
def getargspec(func: object) -> ArgSpec: ...
|
||||
|
||||
class FullArgSpec(NamedTuple):
|
||||
args: list[str]
|
||||
varargs: str | None
|
||||
varkw: str | None
|
||||
defaults: Tuple[Any, ...] | None
|
||||
defaults: tuple[Any, ...] | None
|
||||
kwonlyargs: list[str]
|
||||
kwonlydefaults: dict[str, Any] | None
|
||||
annotations: dict[str, Any]
|
||||
@@ -291,7 +291,7 @@ if sys.version_info < (3, 11):
|
||||
args: list[str],
|
||||
varargs: str | None = ...,
|
||||
varkw: str | None = ...,
|
||||
defaults: Tuple[Any, ...] | None = ...,
|
||||
defaults: tuple[Any, ...] | None = ...,
|
||||
kwonlyargs: Sequence[str] | None = ...,
|
||||
kwonlydefaults: dict[str, Any] | None = ...,
|
||||
annotations: dict[str, Any] = ...,
|
||||
@@ -313,7 +313,7 @@ def formatargvalues(
|
||||
formatvarkw: Callable[[str], str] | None = ...,
|
||||
formatvalue: Callable[[Any], str] | None = ...,
|
||||
) -> str: ...
|
||||
def getmro(cls: type) -> Tuple[type, ...]: ...
|
||||
def getmro(cls: type) -> tuple[type, ...]: ...
|
||||
def getcallargs(__func: Callable[..., Any], *args: Any, **kwds: Any) -> dict[str, Any]: ...
|
||||
|
||||
class ClosureVars(NamedTuple):
|
||||
|
||||
@@ -4,7 +4,7 @@ import sys
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
|
||||
from os import _Opener
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, TextIO, Tuple, Type
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, TextIO, Type
|
||||
|
||||
DEFAULT_BUFFER_SIZE: int
|
||||
|
||||
@@ -119,7 +119,7 @@ class BufferedRWPair(BufferedIOBase):
|
||||
class TextIOBase(IOBase):
|
||||
encoding: str
|
||||
errors: str | None
|
||||
newlines: str | Tuple[str, ...] | None
|
||||
newlines: str | tuple[str, ...] | None
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
|
||||
def __next__(self) -> str: ... # type: ignore[override]
|
||||
def detach(self) -> BinaryIO: ...
|
||||
@@ -179,4 +179,4 @@ class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
|
||||
def __init__(self, decoder: codecs.IncrementalDecoder | None, translate: bool, errors: str = ...) -> None: ...
|
||||
def decode(self, input: bytes | str, final: bool = ...) -> str: ...
|
||||
@property
|
||||
def newlines(self) -> str | Tuple[str, ...] | None: ...
|
||||
def newlines(self) -> str | tuple[str, ...] | None: ...
|
||||
|
||||
@@ -9,7 +9,6 @@ from typing import (
|
||||
SupportsComplex,
|
||||
SupportsFloat,
|
||||
SupportsInt,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
Union,
|
||||
@@ -91,7 +90,7 @@ class filterfalse(Iterator[_T], Generic[_T]):
|
||||
_T1 = TypeVar("_T1")
|
||||
_T2 = TypeVar("_T2")
|
||||
|
||||
class groupby(Iterator[Tuple[_T, Iterator[_S]]], Generic[_T, _S]):
|
||||
class groupby(Iterator[tuple[_T, Iterator[_S]]], Generic[_T, _S]):
|
||||
@overload
|
||||
def __new__(cls, iterable: Iterable[_T1], key: None = ...) -> groupby[_T1, _T1]: ...
|
||||
@overload
|
||||
@@ -117,7 +116,7 @@ class takewhile(Iterator[_T], Generic[_T]):
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __next__(self) -> _T: ...
|
||||
|
||||
def tee(__iterable: Iterable[_T], __n: int = ...) -> Tuple[Iterator[_T], ...]: ...
|
||||
def tee(__iterable: Iterable[_T], __n: int = ...) -> tuple[Iterator[_T], ...]: ...
|
||||
|
||||
class zip_longest(Iterator[Any]):
|
||||
def __init__(self, *p: Iterable[Any], fillvalue: Any = ...) -> None: ...
|
||||
@@ -170,18 +169,18 @@ class product(Iterator[_T_co], Generic[_T_co]):
|
||||
__iter6: Iterable[Any],
|
||||
__iter7: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> product[Tuple[Any, ...]]: ...
|
||||
) -> product[tuple[Any, ...]]: ...
|
||||
@overload
|
||||
def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[Tuple[_T1, ...]]: ...
|
||||
def __new__(cls, *iterables: Iterable[_T1], repeat: int) -> product[tuple[_T1, ...]]: ...
|
||||
@overload
|
||||
def __new__(cls, *iterables: Iterable[Any], repeat: int = ...) -> product[Tuple[Any, ...]]: ...
|
||||
def __new__(cls, *iterables: Iterable[Any], repeat: int = ...) -> product[tuple[Any, ...]]: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
class permutations(Iterator[Tuple[_T, ...]], Generic[_T]):
|
||||
class permutations(Iterator[tuple[_T, ...]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], r: int | None = ...) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[_T, ...]]: ...
|
||||
def __next__(self) -> Tuple[_T, ...]: ...
|
||||
def __iter__(self) -> Iterator[tuple[_T, ...]]: ...
|
||||
def __next__(self) -> tuple[_T, ...]: ...
|
||||
|
||||
class combinations(Iterator[_T_co], Generic[_T_co]):
|
||||
@overload
|
||||
@@ -193,14 +192,14 @@ class combinations(Iterator[_T_co], Generic[_T_co]):
|
||||
@overload
|
||||
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 __new__(cls, iterable: Iterable[_T], r: int) -> combinations[tuple[_T, ...]]: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
|
||||
class combinations_with_replacement(Iterator[Tuple[_T, ...]], Generic[_T]):
|
||||
class combinations_with_replacement(Iterator[tuple[_T, ...]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], r: int) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[_T, ...]]: ...
|
||||
def __next__(self) -> Tuple[_T, ...]: ...
|
||||
def __iter__(self) -> Iterator[tuple[_T, ...]]: ...
|
||||
def __next__(self) -> tuple[_T, ...]: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class pairwise(Iterator[_T_co], Generic[_T_co]):
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from _typeshed import StrPath
|
||||
from typing import Dict, List, Optional, Tuple, TypeVar
|
||||
from typing import Optional, TypeVar
|
||||
|
||||
_P = TypeVar("_P")
|
||||
_Label = Tuple[int, Optional[str]]
|
||||
_DFA = List[List[Tuple[int, int]]]
|
||||
_DFAS = Tuple[_DFA, Dict[int, int]]
|
||||
_Label = tuple[int, Optional[str]]
|
||||
_DFA = list[list[tuple[int, int]]]
|
||||
_DFAS = tuple[_DFA, dict[int, int]]
|
||||
|
||||
class Grammar:
|
||||
symbol2number: dict[str, int]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from lib2to3.pgen2.token import * # noqa
|
||||
from typing import Callable, Iterable, Iterator, Tuple
|
||||
from typing import Callable, Iterable, Iterator
|
||||
|
||||
_Coord = Tuple[int, int]
|
||||
_Coord = tuple[int, int]
|
||||
_TokenEater = Callable[[int, str, _Coord, _Coord, str], None]
|
||||
_TokenInfo = Tuple[int, str, _Coord, _Coord, str]
|
||||
_TokenInfo = tuple[int, str, _Coord, _Coord, str]
|
||||
|
||||
class TokenError(Exception): ...
|
||||
class StopTokenizing(Exception): ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar, Union
|
||||
from typing import Any, Callable, Iterator, Optional, TypeVar, Union
|
||||
|
||||
_P = TypeVar("_P")
|
||||
_NL = Union[Node, Leaf]
|
||||
_Context = Tuple[str, int, int]
|
||||
_Results = Dict[str, _NL]
|
||||
_RawNode = Tuple[int, str, _Context, Optional[List[_NL]]]
|
||||
_Context = tuple[str, int, int]
|
||||
_Results = dict[str, _NL]
|
||||
_RawNode = tuple[int, str, _Context, Optional[list[_NL]]]
|
||||
_Convert = Callable[[Grammar, _RawNode], Any]
|
||||
|
||||
HUGE: int
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Dict, List, Protocol, Tuple
|
||||
from typing import Any, Protocol
|
||||
|
||||
_ModuleGlobals = Dict[str, Any]
|
||||
_ModuleMetadata = Tuple[int, float, List[str], str]
|
||||
_ModuleGlobals = dict[str, Any]
|
||||
_ModuleMetadata = tuple[int, float, list[str], str]
|
||||
|
||||
class _SourceLoader(Protocol):
|
||||
def __call__(self) -> str | None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ import sys
|
||||
# as a type annotation or type alias.
|
||||
from builtins import str as _str
|
||||
from decimal import Decimal
|
||||
from typing import Any, Callable, Iterable, Mapping, Sequence, Tuple
|
||||
from typing import Any, Callable, Iterable, Mapping, Sequence
|
||||
|
||||
CODESET: int
|
||||
D_T_FMT: int
|
||||
@@ -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: ...
|
||||
|
||||
@@ -6,12 +6,12 @@ from io import TextIOWrapper
|
||||
from string import Template
|
||||
from time import struct_time
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, ClassVar, Generic, Optional, Pattern, TextIO, Tuple, Type, TypeVar, Union, overload
|
||||
from typing import Any, ClassVar, Generic, Optional, Pattern, TextIO, Type, TypeVar, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
_SysExcInfoType = Union[Tuple[Type[BaseException], BaseException, Optional[TracebackType]], Tuple[None, None, None]]
|
||||
_SysExcInfoType = Union[tuple[Type[BaseException], BaseException, Optional[TracebackType]], tuple[None, None, None]]
|
||||
_ExcInfoType = Union[None, bool, _SysExcInfoType, BaseException]
|
||||
_ArgsType = Union[Tuple[object, ...], Mapping[str, object]]
|
||||
_ArgsType = Union[tuple[object, ...], Mapping[str, object]]
|
||||
_FilterType = Union[Filter, Callable[[LogRecord], int]]
|
||||
_Level = Union[int, str]
|
||||
_FormatStyle = Literal["%", "{", "$"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Dict, Mapping, Sequence, Union
|
||||
from typing import Mapping, Sequence, Union
|
||||
|
||||
_Cap = Dict[str, Union[str, int]]
|
||||
_Cap = dict[str, Union[str, int]]
|
||||
|
||||
def findmatch(
|
||||
caps: Mapping[str, list[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from typing import IO, Sequence, Tuple
|
||||
from typing import IO, Sequence
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def guess_type(url: StrPath, strict: bool = ...) -> tuple[str | None, str | None]: ...
|
||||
@@ -26,7 +26,7 @@ class MimeTypes:
|
||||
encodings_map: 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 __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_all_extensions(self, type: str, strict: bool = ...) -> list[str]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import CodeType
|
||||
from typing import IO, Any, Container, Iterable, Iterator, Sequence, Tuple
|
||||
from typing import IO, Any, Container, Iterable, Iterator, Sequence
|
||||
|
||||
LOAD_CONST: int # undocumented
|
||||
IMPORT_NAME: int # undocumented
|
||||
@@ -62,7 +62,7 @@ class ModuleFinder:
|
||||
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 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from typing import Any, Container, Iterable, Sequence, Tuple, Type
|
||||
from typing import Any, Container, Iterable, Sequence, Type
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform == "win32":
|
||||
@@ -37,7 +37,7 @@ if sys.platform == "win32":
|
||||
seqno: int | Type[_Unspecified] = ...,
|
||||
cond: str | Type[_Unspecified] = ...,
|
||||
) -> None: ...
|
||||
def add_data(db: _Database, table: str, values: Iterable[Tuple[Any, ...]]) -> None: ...
|
||||
def add_data(db: _Database, table: str, values: Iterable[tuple[Any, ...]]) -> None: ...
|
||||
def add_stream(db: _Database, name: str, path: str) -> None: ...
|
||||
def init_database(
|
||||
name: str, schema: ModuleType, ProductName: str, ProductCode: str, ProductVersion: str, Manufacturer: str
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import sys
|
||||
from typing import List, Optional, Tuple
|
||||
from typing import Optional
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
_SequenceType = List[Tuple[str, Optional[str], int]]
|
||||
_SequenceType = list[tuple[str, Optional[str], int]]
|
||||
|
||||
AdminExecuteSequence: _SequenceType
|
||||
AdminUISequence: _SequenceType
|
||||
|
||||
@@ -2,13 +2,13 @@ import socket
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from typing import Any, Iterable, Tuple, Type, Union
|
||||
from typing import Any, Iterable, Type, Union
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import SupportsIndex
|
||||
|
||||
# https://docs.python.org/3/library/multiprocessing.html#address-formats
|
||||
_Address = Union[str, Tuple[str, int]]
|
||||
_Address = Union[str, tuple[str, int]]
|
||||
|
||||
class _ConnectionBase:
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from _typeshed import Self
|
||||
from queue import Queue
|
||||
from types import TracebackType
|
||||
from typing import Any, Tuple, Type, Union
|
||||
from typing import Any, Type, Union
|
||||
|
||||
families: list[None]
|
||||
|
||||
_Address = Union[str, Tuple[str, int]]
|
||||
_Address = Union[str, tuple[str, int]]
|
||||
|
||||
class Connection(object):
|
||||
_in: Any
|
||||
|
||||
@@ -4,7 +4,7 @@ import queue
|
||||
import sys
|
||||
import threading
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Mapping, Sequence, Tuple, TypeVar
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Mapping, Sequence, TypeVar
|
||||
|
||||
from .connection import Connection
|
||||
from .context import BaseContext
|
||||
@@ -52,7 +52,7 @@ class BaseProxy(object):
|
||||
manager_owned: bool = ...,
|
||||
) -> None: ...
|
||||
def __deepcopy__(self, memo: Any | None) -> Any: ...
|
||||
def _callmethod(self, methodname: str, args: Tuple[Any, ...] = ..., kwds: dict[Any, Any] = ...) -> None: ...
|
||||
def _callmethod(self, methodname: str, args: tuple[Any, ...] = ..., kwds: dict[Any, Any] = ...) -> None: ...
|
||||
def _getvalue(self) -> Any: ...
|
||||
def __reduce__(self) -> tuple[Any, tuple[Any, Any, str, dict[Any, Any]]]: ...
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from contextlib import AbstractContextManager
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, List, Mapping, TypeVar
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -32,7 +32,7 @@ class ApplyResult(Generic[_T]):
|
||||
# alias created during issue #17805
|
||||
AsyncResult = ApplyResult
|
||||
|
||||
class MapResult(ApplyResult[List[_T]]):
|
||||
class MapResult(ApplyResult[list[_T]]):
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Mapping, Tuple
|
||||
from typing import Any, Callable, Mapping
|
||||
|
||||
class BaseProcess:
|
||||
name: str
|
||||
daemon: bool
|
||||
authkey: bytes
|
||||
_identity: Tuple[int, ...] # undocumented
|
||||
_identity: tuple[int, ...] # undocumented
|
||||
def __init__(
|
||||
self,
|
||||
group: None = ...,
|
||||
target: Callable[..., Any] | None = ...,
|
||||
name: str | None = ...,
|
||||
args: Tuple[Any, ...] = ...,
|
||||
args: tuple[Any, ...] = ...,
|
||||
kwargs: Mapping[str, Any] = ...,
|
||||
*,
|
||||
daemon: bool | None = ...,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Any, Generic, Iterable, Tuple, TypeVar
|
||||
from typing import Any, Generic, Iterable, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
@@ -23,7 +23,7 @@ if sys.version_info >= (3, 8):
|
||||
def __init__(self, sequence: Iterable[_SLT] | None = ..., *, name: str | None = ...) -> None: ...
|
||||
def __getitem__(self, position: int) -> _SLT: ...
|
||||
def __setitem__(self, position: int, value: _SLT) -> None: ...
|
||||
def __reduce__(self: _S) -> tuple[_S, Tuple[_SLT, ...]]: ...
|
||||
def __reduce__(self: _S) -> tuple[_S, tuple[_SLT, ...]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@property
|
||||
def format(self) -> str: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import Optional, Tuple
|
||||
from typing import Optional
|
||||
|
||||
class NetrcParseError(Exception):
|
||||
filename: str | None
|
||||
@@ -8,7 +8,7 @@ class NetrcParseError(Exception):
|
||||
def __init__(self, msg: str, filename: StrOrBytesPath | None = ..., lineno: int | None = ...) -> None: ...
|
||||
|
||||
# (login, account, password) tuple
|
||||
_NetrcTuple = Tuple[str, Optional[str], Optional[str]]
|
||||
_NetrcTuple = tuple[str, Optional[str], Optional[str]]
|
||||
|
||||
class netrc:
|
||||
hosts: dict[str, _NetrcTuple]
|
||||
|
||||
@@ -3,7 +3,7 @@ import socket
|
||||
import ssl
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import IO, Any, Iterable, NamedTuple, Tuple, Union
|
||||
from typing import IO, Any, Iterable, NamedTuple, Union
|
||||
|
||||
_File = Union[IO[bytes], bytes, str, None]
|
||||
|
||||
@@ -72,7 +72,7 @@ class _NNTPBase:
|
||||
def xhdr(self, hdr: str, str: Any, *, file: _File = ...) -> tuple[str, _list[str]]: ...
|
||||
def xover(self, start: int, end: int, *, file: _File = ...) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ...
|
||||
def over(
|
||||
self, message_spec: None | str | _list[Any] | Tuple[Any, ...], *, file: _File = ...
|
||||
self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = ...
|
||||
) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ...
|
||||
if sys.version_info < (3, 9):
|
||||
def xgtitle(self, group: str, *, file: _File = ...) -> tuple[str, _list[tuple[str, str]]]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import IO, Any, AnyStr, Callable, Iterable, Mapping, Sequence, Tuple, Type, overload
|
||||
from typing import IO, Any, AnyStr, Callable, Iterable, Mapping, Sequence, Type, overload
|
||||
|
||||
NO_DEFAULT: Tuple[str, ...]
|
||||
NO_DEFAULT: tuple[str, ...]
|
||||
SUPPRESS_HELP: str
|
||||
SUPPRESS_USAGE: str
|
||||
|
||||
@@ -72,14 +72,14 @@ class TitledHelpFormatter(HelpFormatter):
|
||||
def format_usage(self, usage: str) -> str: ...
|
||||
|
||||
class Option:
|
||||
ACTIONS: Tuple[str, ...]
|
||||
ALWAYS_TYPED_ACTIONS: Tuple[str, ...]
|
||||
ACTIONS: tuple[str, ...]
|
||||
ALWAYS_TYPED_ACTIONS: tuple[str, ...]
|
||||
ATTRS: list[str]
|
||||
CHECK_METHODS: list[Callable[..., Any]] | None
|
||||
CONST_ACTIONS: Tuple[str, ...]
|
||||
STORE_ACTIONS: Tuple[str, ...]
|
||||
TYPED_ACTIONS: Tuple[str, ...]
|
||||
TYPES: Tuple[str, ...]
|
||||
CONST_ACTIONS: tuple[str, ...]
|
||||
STORE_ACTIONS: tuple[str, ...]
|
||||
TYPED_ACTIONS: tuple[str, ...]
|
||||
TYPES: tuple[str, ...]
|
||||
TYPE_CHECKER: dict[str, Callable[..., Any]]
|
||||
_long_opts: list[str]
|
||||
_short_opts: list[str]
|
||||
@@ -89,7 +89,7 @@ class Option:
|
||||
nargs: int
|
||||
type: Any
|
||||
callback: Callable[..., Any] | None
|
||||
callback_args: Tuple[Any, ...] | None
|
||||
callback_args: tuple[Any, ...] | None
|
||||
callback_kwargs: dict[str, Any] | None
|
||||
help: str | None
|
||||
metavar: str | None
|
||||
|
||||
@@ -24,13 +24,11 @@ from typing import (
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
NoReturn,
|
||||
Protocol,
|
||||
Sequence,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
@@ -284,7 +282,7 @@ TMP_MAX: int # Undocumented, but used by tempfile
|
||||
|
||||
# ----- os classes (structures) -----
|
||||
@final
|
||||
class stat_result(structseq[float], Tuple[int, int, int, int, int, int, int, float, float, float]):
|
||||
class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, float, float, float]):
|
||||
# The constructor of this class takes an iterable of variable length (though it must be at least 10).
|
||||
#
|
||||
# However, this class behaves like a tuple of 10 elements,
|
||||
@@ -383,7 +381,7 @@ class DirEntry(Generic[AnyStr]):
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
@final
|
||||
class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int, int]):
|
||||
class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, int, int, int, int]):
|
||||
@property
|
||||
def f_bsize(self) -> int: ...
|
||||
@property
|
||||
@@ -409,7 +407,7 @@ if sys.version_info >= (3, 7):
|
||||
|
||||
else:
|
||||
@final
|
||||
class statvfs_result(structseq[int], Tuple[int, int, int, int, int, int, int, int, int, int]):
|
||||
class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, int, int, int]):
|
||||
@property
|
||||
def f_bsize(self) -> int: ...
|
||||
@property
|
||||
@@ -447,7 +445,7 @@ def getppid() -> int: ...
|
||||
def strerror(__code: int) -> str: ...
|
||||
def umask(__mask: int) -> int: ...
|
||||
@final
|
||||
class uname_result(structseq[str], Tuple[str, str, str, str, str]):
|
||||
class uname_result(structseq[str], tuple[str, str, str, str, str]):
|
||||
@property
|
||||
def sysname(self) -> str: ...
|
||||
@property
|
||||
@@ -639,7 +637,7 @@ if sys.platform != "win32":
|
||||
def writev(__fd: int, __buffers: Sequence[bytes]) -> int: ...
|
||||
|
||||
@final
|
||||
class terminal_size(structseq[int], Tuple[int, int]):
|
||||
class terminal_size(structseq[int], tuple[int, int]):
|
||||
@property
|
||||
def columns(self) -> int: ...
|
||||
@property
|
||||
@@ -813,14 +811,14 @@ def execlpe(file: StrOrBytesPath, __arg0: StrOrBytesPath, *args: Any) -> NoRetur
|
||||
# in practice, and doing so would explode the number of combinations in this already long union.
|
||||
# All these combinations are necessary due to list being invariant.
|
||||
_ExecVArgs = Union[
|
||||
Tuple[StrOrBytesPath, ...],
|
||||
List[bytes],
|
||||
List[str],
|
||||
List[PathLike[Any]],
|
||||
List[Union[bytes, str]],
|
||||
List[Union[bytes, PathLike[Any]]],
|
||||
List[Union[str, PathLike[Any]]],
|
||||
List[Union[bytes, str, PathLike[Any]]],
|
||||
tuple[StrOrBytesPath, ...],
|
||||
list[bytes],
|
||||
list[str],
|
||||
list[PathLike[Any]],
|
||||
list[Union[bytes, str]],
|
||||
list[Union[bytes, PathLike[Any]]],
|
||||
list[Union[str, PathLike[Any]]],
|
||||
list[Union[bytes, str, PathLike[Any]]],
|
||||
]
|
||||
_ExecEnv = Union[Mapping[bytes, Union[bytes, str]], Mapping[str, Union[bytes, str]]]
|
||||
|
||||
@@ -858,7 +856,7 @@ else:
|
||||
|
||||
def system(command: StrOrBytesPath) -> int: ...
|
||||
@final
|
||||
class times_result(structseq[float], Tuple[float, float, float, float, float]):
|
||||
class times_result(structseq[float], tuple[float, float, float, float, float]):
|
||||
@property
|
||||
def user(self) -> float: ...
|
||||
@property
|
||||
@@ -884,7 +882,7 @@ else:
|
||||
def wait() -> tuple[int, int]: ... # Unix only
|
||||
if sys.platform != "darwin":
|
||||
@final
|
||||
class waitid_result(structseq[int], Tuple[int, int, int, int, int]):
|
||||
class waitid_result(structseq[int], tuple[int, int, int, int, int]):
|
||||
@property
|
||||
def si_pid(self) -> int: ...
|
||||
@property
|
||||
@@ -912,7 +910,7 @@ else:
|
||||
argv: _ExecVArgs,
|
||||
env: _ExecEnv,
|
||||
*,
|
||||
file_actions: Sequence[Tuple[Any, ...]] | None = ...,
|
||||
file_actions: Sequence[tuple[Any, ...]] | None = ...,
|
||||
setpgroup: int | None = ...,
|
||||
resetids: bool = ...,
|
||||
setsid: bool = ...,
|
||||
@@ -925,7 +923,7 @@ else:
|
||||
argv: _ExecVArgs,
|
||||
env: _ExecEnv,
|
||||
*,
|
||||
file_actions: Sequence[Tuple[Any, ...]] | None = ...,
|
||||
file_actions: Sequence[tuple[Any, ...]] | None = ...,
|
||||
setpgroup: int | None = ...,
|
||||
resetids: bool = ...,
|
||||
setsid: bool = ...,
|
||||
@@ -936,7 +934,7 @@ else:
|
||||
|
||||
if sys.platform != "win32":
|
||||
@final
|
||||
class sched_param(structseq[int], Tuple[int]):
|
||||
class sched_param(structseq[int], tuple[int]):
|
||||
def __new__(cls, sched_priority: int) -> sched_param: ...
|
||||
@property
|
||||
def sched_priority(self) -> int: ...
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from types import CodeType
|
||||
from typing import Any, Sequence, Tuple
|
||||
from typing import Any, Sequence
|
||||
|
||||
def expr(source: str) -> STType: ...
|
||||
def suite(source: str) -> STType: ...
|
||||
def sequence2st(sequence: Sequence[Any]) -> STType: ...
|
||||
def tuple2st(sequence: Sequence[Any]) -> STType: ...
|
||||
def st2list(st: STType, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ...
|
||||
def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> Tuple[Any, ...]: ...
|
||||
def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ...
|
||||
def compilest(st: STType, filename: StrOrBytesPath = ...) -> CodeType: ...
|
||||
def isexpr(st: STType) -> bool: ...
|
||||
def issuite(st: STType) -> bool: ...
|
||||
@@ -19,4 +19,4 @@ class STType:
|
||||
def isexpr(self) -> bool: ...
|
||||
def issuite(self) -> bool: ...
|
||||
def tolist(self, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ...
|
||||
def totuple(self, line_info: bool = ..., col_info: bool = ...) -> Tuple[Any, ...]: ...
|
||||
def totuple(self, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ...
|
||||
|
||||
@@ -11,7 +11,7 @@ from _typeshed import (
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
from os import PathLike, stat_result
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, BinaryIO, Generator, Sequence, Tuple, Type, TypeVar, overload
|
||||
from typing import IO, Any, BinaryIO, Generator, Sequence, Type, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -20,7 +20,7 @@ if sys.version_info >= (3, 9):
|
||||
_P = TypeVar("_P", bound=PurePath)
|
||||
|
||||
class PurePath(PathLike[str]):
|
||||
parts: Tuple[str, ...]
|
||||
parts: tuple[str, ...]
|
||||
drive: str
|
||||
root: str
|
||||
anchor: str
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
from typing import Any, Callable, ClassVar, Iterable, Iterator, Mapping, Optional, Protocol, Tuple, Type, Union
|
||||
from typing import Any, Callable, ClassVar, Iterable, Iterator, Mapping, Optional, Protocol, Type, Union
|
||||
from typing_extensions import final
|
||||
|
||||
HIGHEST_PROTOCOL: int
|
||||
DEFAULT_PROTOCOL: int
|
||||
|
||||
bytes_types: Tuple[Type[Any], ...] # undocumented
|
||||
bytes_types: tuple[Type[Any], ...] # undocumented
|
||||
|
||||
class _ReadableFileobj(Protocol):
|
||||
def read(self, __n: int) -> bytes: ...
|
||||
@@ -58,10 +58,10 @@ class UnpicklingError(PickleError): ...
|
||||
|
||||
_reducedtype = Union[
|
||||
str,
|
||||
Tuple[Callable[..., Any], Tuple[Any, ...]],
|
||||
Tuple[Callable[..., Any], Tuple[Any, ...], Any],
|
||||
Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]]],
|
||||
Tuple[Callable[..., Any], Tuple[Any, ...], Any, Optional[Iterator[Any]], Optional[Iterator[Any]]],
|
||||
tuple[Callable[..., Any], tuple[Any, ...]],
|
||||
tuple[Callable[..., Any], tuple[Any, ...], Any],
|
||||
tuple[Callable[..., Any], tuple[Any, ...], Any, Optional[Iterator[Any]]],
|
||||
tuple[Callable[..., Any], tuple[Any, ...], Any, Optional[Iterator[Any]], Optional[Iterator[Any]]],
|
||||
]
|
||||
|
||||
class Pickler:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import IO, Any, Callable, Iterator, MutableMapping, Tuple, Type
|
||||
from typing import IO, Any, Callable, Iterator, MutableMapping, Type
|
||||
|
||||
_Reader = Callable[[IO[bytes]], Any]
|
||||
bytes_types: Tuple[Type[Any], ...]
|
||||
bytes_types: tuple[Type[Any], ...]
|
||||
|
||||
UP_TO_NEWLINE: int
|
||||
TAKEN_FROM_ARGUMENT1: int
|
||||
@@ -108,9 +108,9 @@ long4: ArgumentDescriptor
|
||||
|
||||
class StackObject(object):
|
||||
name: str
|
||||
obtype: Type[Any] | Tuple[Type[Any], ...]
|
||||
obtype: Type[Any] | tuple[Type[Any], ...]
|
||||
doc: str
|
||||
def __init__(self, name: str, obtype: Type[Any] | Tuple[Type[Any], ...], doc: str) -> None: ...
|
||||
def __init__(self, name: str, obtype: Type[Any] | tuple[Type[Any], ...], doc: str) -> None: ...
|
||||
|
||||
pyint: StackObject
|
||||
pylong: StackObject
|
||||
|
||||
@@ -4,7 +4,7 @@ if sys.version_info < (3, 8):
|
||||
import os
|
||||
|
||||
DEV_NULL = os.devnull
|
||||
from typing import NamedTuple, Tuple
|
||||
from typing import NamedTuple
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def libc_ver(executable: str | None = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> tuple[str, str]: ...
|
||||
@@ -17,11 +17,11 @@ if sys.version_info < (3, 8):
|
||||
distname: str = ...,
|
||||
version: str = ...,
|
||||
id: str = ...,
|
||||
supported_dists: Tuple[str, ...] = ...,
|
||||
supported_dists: tuple[str, ...] = ...,
|
||||
full_distribution_name: bool = ...,
|
||||
) -> tuple[str, str, str]: ...
|
||||
def dist(
|
||||
distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...
|
||||
distname: str = ..., version: str = ..., id: str = ..., supported_dists: tuple[str, ...] = ...
|
||||
) -> tuple[str, str, str]: ...
|
||||
|
||||
def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> tuple[str, str, str, str]: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from typing import IO, Any, Dict as _Dict, Mapping, MutableMapping, Tuple, Type
|
||||
from typing import IO, Any, Mapping, MutableMapping, Type
|
||||
|
||||
class PlistFormat(Enum):
|
||||
FMT_XML: int
|
||||
@@ -31,7 +31,7 @@ else:
|
||||
) -> Any: ...
|
||||
|
||||
def dump(
|
||||
value: Mapping[str, Any] | list[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
|
||||
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime,
|
||||
fp: IO[bytes],
|
||||
*,
|
||||
fmt: PlistFormat = ...,
|
||||
@@ -39,7 +39,7 @@ def dump(
|
||||
skipkeys: bool = ...,
|
||||
) -> None: ...
|
||||
def dumps(
|
||||
value: Mapping[str, Any] | list[Any] | Tuple[Any, ...] | str | bool | float | bytes | datetime,
|
||||
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime,
|
||||
*,
|
||||
fmt: PlistFormat = ...,
|
||||
skipkeys: bool = ...,
|
||||
@@ -53,7 +53,7 @@ if sys.version_info < (3, 9):
|
||||
def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ...
|
||||
|
||||
if sys.version_info < (3, 7):
|
||||
class Dict(_Dict[str, Any]):
|
||||
class Dict(dict[str, Any]):
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
def __setattr__(self, attr: str, value: Any) -> None: ...
|
||||
def __delattr__(self, attr: str) -> None: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import socket
|
||||
import ssl
|
||||
from typing import Any, BinaryIO, List, Pattern, Tuple, overload
|
||||
from typing import Any, BinaryIO, Pattern, overload
|
||||
|
||||
_LongResp = Tuple[bytes, List[bytes], int]
|
||||
_LongResp = tuple[bytes, list[bytes], int]
|
||||
|
||||
class error_proto(Exception): ...
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import Any, Callable, Tuple, TypeVar
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
|
||||
def runctx(
|
||||
@@ -8,7 +8,7 @@ def runctx(
|
||||
|
||||
_SelfT = TypeVar("_SelfT", bound=Profile)
|
||||
_T = TypeVar("_T")
|
||||
_Label = Tuple[str, int, str]
|
||||
_Label = tuple[str, int, str]
|
||||
|
||||
class Profile:
|
||||
bias: int
|
||||
|
||||
@@ -2,7 +2,7 @@ import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from cProfile import Profile as _cProfile
|
||||
from profile import Profile
|
||||
from typing import IO, Any, Iterable, Tuple, TypeVar, Union, overload
|
||||
from typing import IO, Any, Iterable, TypeVar, Union, overload
|
||||
|
||||
_Selector = Union[str, float, int]
|
||||
_T = TypeVar("_T", bound=Stats)
|
||||
@@ -33,7 +33,7 @@ class Stats:
|
||||
def get_top_level_stats(self) -> None: ...
|
||||
def add(self: _T, *arg_list: None | str | Profile | _cProfile | _T) -> _T: ...
|
||||
def dump_stats(self, filename: StrOrBytesPath) -> None: ...
|
||||
def get_sort_arg_defs(self) -> dict[str, tuple[Tuple[tuple[int, int], ...], str]]: ...
|
||||
def get_sort_arg_defs(self) -> dict[str, tuple[tuple[tuple[int, int], ...], str]]: ...
|
||||
@overload
|
||||
def sort_stats(self: _T, field: int) -> _T: ...
|
||||
@overload
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from _typeshed import structseq
|
||||
from typing import Any, Tuple
|
||||
from typing import Any
|
||||
from typing_extensions import final
|
||||
|
||||
@final
|
||||
class struct_passwd(structseq[Any], Tuple[str, str, int, int, str, str, str]):
|
||||
class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]):
|
||||
@property
|
||||
def pw_name(self) -> str: ...
|
||||
@property
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from _typeshed import SupportsWrite
|
||||
from reprlib import Repr
|
||||
from types import MethodType, ModuleType, TracebackType
|
||||
from typing import IO, Any, AnyStr, Callable, Container, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type
|
||||
from typing import IO, Any, AnyStr, Callable, Container, Mapping, MutableMapping, NoReturn, Optional, Type
|
||||
|
||||
# the return type of sys.exc_info(), used by ErrorDuringImport.__init__
|
||||
_Exc_Info = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
_Exc_Info = tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
|
||||
|
||||
__author__: str
|
||||
__date__: str
|
||||
@@ -96,7 +96,7 @@ class HTMLDoc(Doc):
|
||||
methods: Mapping[str, str] = ...,
|
||||
) -> str: ...
|
||||
def formattree(
|
||||
self, tree: list[tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ...
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ...
|
||||
) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
|
||||
def docclass(
|
||||
@@ -143,7 +143,7 @@ class TextDoc(Doc):
|
||||
def indent(self, text: str, prefix: str = ...) -> str: ...
|
||||
def section(self, title: str, contents: str) -> str: ...
|
||||
def formattree(
|
||||
self, tree: list[tuple[type, Tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ...
|
||||
self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = ..., prefix: str = ...
|
||||
) -> str: ...
|
||||
def docmodule(self, object: object, name: str | None = ..., mod: Any | None = ...) -> str: ... # type: ignore[override]
|
||||
def docclass(self, object: object, name: str | None = ..., mod: str | None = ..., *ignored: Any) -> str: ...
|
||||
@@ -187,7 +187,7 @@ _list = list # "list" conflicts with method name
|
||||
class Helper:
|
||||
keywords: dict[str, str | tuple[str, str]]
|
||||
symbols: dict[str, str]
|
||||
topics: dict[str, str | Tuple[str, ...]]
|
||||
topics: dict[str, str | tuple[str, ...]]
|
||||
def __init__(self, input: IO[str] | None = ..., output: IO[str] | None = ...) -> None: ...
|
||||
input: IO[str]
|
||||
output: IO[str]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user