mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -13,14 +13,11 @@ from typing import (
|
||||
ByteString,
|
||||
Callable,
|
||||
Container,
|
||||
Dict,
|
||||
FrozenSet,
|
||||
Generic,
|
||||
ItemsView,
|
||||
Iterable,
|
||||
Iterator,
|
||||
KeysView,
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
MutableSequence,
|
||||
@@ -29,15 +26,12 @@ from typing import (
|
||||
Protocol,
|
||||
Reversible,
|
||||
Sequence,
|
||||
Set,
|
||||
Sized,
|
||||
SupportsAbs,
|
||||
SupportsComplex,
|
||||
SupportsFloat,
|
||||
SupportsInt,
|
||||
Text,
|
||||
Tuple,
|
||||
Type,
|
||||
TypeVar,
|
||||
ValuesView,
|
||||
overload,
|
||||
@@ -64,12 +58,12 @@ _TT = TypeVar("_TT", bound=type)
|
||||
|
||||
class object:
|
||||
__doc__: str | None
|
||||
__dict__: Dict[str, Any]
|
||||
__dict__: dict[str, Any]
|
||||
__module__: str
|
||||
@property
|
||||
def __class__(self: _T) -> Type[_T]: ...
|
||||
def __class__(self: _T) -> type[_T]: ...
|
||||
@__class__.setter
|
||||
def __class__(self, __type: Type[object]) -> None: ... # noqa: F811
|
||||
def __class__(self, __type: type[object]) -> None: ... # noqa: F811
|
||||
def __init__(self) -> None: ...
|
||||
def __new__(cls) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
@@ -82,46 +76,46 @@ class object:
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
def __sizeof__(self) -> int: ...
|
||||
def __reduce__(self) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce_ex__(self, protocol: int) -> str | Tuple[Any, ...]: ...
|
||||
def __reduce__(self) -> str | tuple[Any, ...]: ...
|
||||
def __reduce_ex__(self, protocol: int) -> str | tuple[Any, ...]: ...
|
||||
|
||||
class staticmethod(object): # Special, only valid as a decorator.
|
||||
__func__: Callable[..., Any]
|
||||
def __init__(self, f: Callable[..., Any]) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Type[_T] | None = ...) -> Callable[..., Any]: ...
|
||||
def __new__(cls: type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: type[_T] | None = ...) -> Callable[..., Any]: ...
|
||||
|
||||
class classmethod(object): # Special, only valid as a decorator.
|
||||
__func__: Callable[..., Any]
|
||||
def __init__(self, f: Callable[..., Any]) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Type[_T] | None = ...) -> Callable[..., Any]: ...
|
||||
def __new__(cls: type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: type[_T] | None = ...) -> Callable[..., Any]: ...
|
||||
|
||||
class type(object):
|
||||
__base__: type
|
||||
__bases__: Tuple[type, ...]
|
||||
__bases__: tuple[type, ...]
|
||||
__basicsize__: int
|
||||
__dict__: Dict[str, Any]
|
||||
__dict__: dict[str, Any]
|
||||
__dictoffset__: int
|
||||
__flags__: int
|
||||
__itemsize__: int
|
||||
__module__: str
|
||||
__mro__: Tuple[type, ...]
|
||||
__mro__: tuple[type, ...]
|
||||
__name__: str
|
||||
__weakrefoffset__: int
|
||||
@overload
|
||||
def __init__(self, o: object) -> None: ...
|
||||
@overload
|
||||
def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ...
|
||||
def __init__(self, name: str, bases: tuple[type, ...], dict: dict[str, Any]) -> None: ...
|
||||
@overload
|
||||
def __new__(cls, o: object) -> type: ...
|
||||
@overload
|
||||
def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
|
||||
def __new__(cls, name: str, bases: tuple[type, ...], namespace: dict[str, Any]) -> type: ...
|
||||
def __call__(self, *args: Any, **kwds: Any) -> Any: ...
|
||||
def __subclasses__(self: _TT) -> List[_TT]: ...
|
||||
def __subclasses__(self: _TT) -> list[_TT]: ...
|
||||
# Note: the documentation doesn't specify what the return type is, the standard
|
||||
# implementation seems to be returning a list.
|
||||
def mro(self) -> List[type]: ...
|
||||
def mro(self) -> list[type]: ...
|
||||
def __instancecheck__(self, instance: Any) -> bool: ...
|
||||
def __subclasscheck__(self, subclass: type) -> bool: ...
|
||||
|
||||
@@ -133,9 +127,9 @@ class super(object):
|
||||
|
||||
class int:
|
||||
@overload
|
||||
def __new__(cls: Type[_T], x: Text | bytes | SupportsInt | _SupportsIndex | _SupportsTrunc = ...) -> _T: ...
|
||||
def __new__(cls: type[_T], x: Text | bytes | SupportsInt | _SupportsIndex | _SupportsTrunc = ...) -> _T: ...
|
||||
@overload
|
||||
def __new__(cls: Type[_T], x: Text | bytes | bytearray, base: int) -> _T: ...
|
||||
def __new__(cls: type[_T], x: Text | bytes | bytearray, base: int) -> _T: ...
|
||||
@property
|
||||
def real(self) -> int: ...
|
||||
@property
|
||||
@@ -153,7 +147,7 @@ class int:
|
||||
def __div__(self, x: int) -> int: ...
|
||||
def __truediv__(self, x: int) -> float: ...
|
||||
def __mod__(self, x: int) -> int: ...
|
||||
def __divmod__(self, x: int) -> Tuple[int, int]: ...
|
||||
def __divmod__(self, x: int) -> tuple[int, int]: ...
|
||||
def __radd__(self, x: int) -> int: ...
|
||||
def __rsub__(self, x: int) -> int: ...
|
||||
def __rmul__(self, x: int) -> int: ...
|
||||
@@ -161,7 +155,7 @@ class int:
|
||||
def __rdiv__(self, x: int) -> int: ...
|
||||
def __rtruediv__(self, x: int) -> float: ...
|
||||
def __rmod__(self, x: int) -> int: ...
|
||||
def __rdivmod__(self, x: int) -> Tuple[int, int]: ...
|
||||
def __rdivmod__(self, x: int) -> tuple[int, int]: ...
|
||||
@overload
|
||||
def __pow__(self, __x: Literal[2], __modulo: int | None = ...) -> int: ...
|
||||
@overload
|
||||
@@ -181,7 +175,7 @@ class int:
|
||||
def __pos__(self) -> int: ...
|
||||
def __invert__(self) -> int: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
def __getnewargs__(self) -> Tuple[int]: ...
|
||||
def __getnewargs__(self) -> tuple[int]: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: int) -> bool: ...
|
||||
@@ -197,8 +191,8 @@ class int:
|
||||
def __index__(self) -> int: ...
|
||||
|
||||
class float:
|
||||
def __new__(cls: Type[_T], x: SupportsFloat | _SupportsIndex | Text | bytes | bytearray = ...) -> _T: ...
|
||||
def as_integer_ratio(self) -> Tuple[int, int]: ...
|
||||
def __new__(cls: type[_T], x: SupportsFloat | _SupportsIndex | Text | bytes | bytearray = ...) -> _T: ...
|
||||
def as_integer_ratio(self) -> tuple[int, int]: ...
|
||||
def hex(self) -> str: ...
|
||||
def is_integer(self) -> bool: ...
|
||||
@classmethod
|
||||
@@ -215,7 +209,7 @@ class float:
|
||||
def __div__(self, x: float) -> float: ...
|
||||
def __truediv__(self, x: float) -> float: ...
|
||||
def __mod__(self, x: float) -> float: ...
|
||||
def __divmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __divmod__(self, x: float) -> tuple[float, float]: ...
|
||||
def __pow__(
|
||||
self, x: float, mod: None = ...
|
||||
) -> float: ... # In Python 3, returns complex if self is negative and x is not whole
|
||||
@@ -226,9 +220,9 @@ class float:
|
||||
def __rdiv__(self, x: float) -> float: ...
|
||||
def __rtruediv__(self, x: float) -> float: ...
|
||||
def __rmod__(self, x: float) -> float: ...
|
||||
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __rdivmod__(self, x: float) -> tuple[float, float]: ...
|
||||
def __rpow__(self, x: float, mod: None = ...) -> float: ...
|
||||
def __getnewargs__(self) -> Tuple[float]: ...
|
||||
def __getnewargs__(self) -> tuple[float]: ...
|
||||
def __trunc__(self) -> int: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
@@ -247,9 +241,9 @@ class float:
|
||||
|
||||
class complex:
|
||||
@overload
|
||||
def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ...
|
||||
def __new__(cls: type[_T], real: float = ..., imag: float = ...) -> _T: ...
|
||||
@overload
|
||||
def __new__(cls: Type[_T], real: str | SupportsComplex | _SupportsIndex) -> _T: ...
|
||||
def __new__(cls: type[_T], real: str | SupportsComplex | _SupportsIndex) -> _T: ...
|
||||
@property
|
||||
def real(self) -> float: ...
|
||||
@property
|
||||
@@ -291,7 +285,7 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def count(self, x: unicode) -> int: ...
|
||||
def decode(self, encoding: unicode = ..., errors: unicode = ...) -> unicode: ...
|
||||
def encode(self, encoding: unicode = ..., errors: unicode = ...) -> str: ...
|
||||
def endswith(self, __suffix: unicode | Tuple[unicode, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def endswith(self, __suffix: unicode | tuple[unicode, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> unicode: ...
|
||||
def find(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def format(self, *args: object, **kwargs: object) -> unicode: ...
|
||||
@@ -311,21 +305,21 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def ljust(self, width: int, fillchar: unicode = ...) -> unicode: ...
|
||||
def lower(self) -> unicode: ...
|
||||
def lstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def partition(self, sep: unicode) -> tuple[unicode, unicode, unicode]: ...
|
||||
def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ...
|
||||
def rfind(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def rindex(self, sub: unicode, start: int = ..., end: int = ...) -> int: ...
|
||||
def rjust(self, width: int, fillchar: unicode = ...) -> unicode: ...
|
||||
def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def rsplit(self, sep: unicode | None = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def rpartition(self, sep: unicode) -> tuple[unicode, unicode, unicode]: ...
|
||||
def rsplit(self, sep: unicode | None = ..., maxsplit: int = ...) -> list[unicode]: ...
|
||||
def rstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def split(self, sep: unicode | None = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> List[unicode]: ...
|
||||
def startswith(self, __prefix: unicode | Tuple[unicode, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def split(self, sep: unicode | None = ..., maxsplit: int = ...) -> list[unicode]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[unicode]: ...
|
||||
def startswith(self, __prefix: unicode | tuple[unicode, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def strip(self, chars: unicode = ...) -> unicode: ...
|
||||
def swapcase(self) -> unicode: ...
|
||||
def title(self) -> unicode: ...
|
||||
def translate(self, table: Dict[int, Any] | unicode) -> unicode: ...
|
||||
def translate(self, table: dict[int, Any] | unicode) -> unicode: ...
|
||||
def upper(self) -> unicode: ...
|
||||
def zfill(self, width: int) -> unicode: ...
|
||||
@overload
|
||||
@@ -352,7 +346,7 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __getnewargs__(self) -> Tuple[unicode]: ...
|
||||
def __getnewargs__(self) -> tuple[unicode]: ...
|
||||
|
||||
class _FormatMapMapping(Protocol):
|
||||
def __getitem__(self, __key: str) -> Any: ...
|
||||
@@ -364,7 +358,7 @@ class str(Sequence[str], basestring):
|
||||
def count(self, x: Text, __start: int | None = ..., __end: int | None = ...) -> int: ...
|
||||
def decode(self, encoding: Text = ..., errors: Text = ...) -> unicode: ...
|
||||
def encode(self, encoding: Text = ..., errors: Text = ...) -> bytes: ...
|
||||
def endswith(self, __suffix: Text | Tuple[Text, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def endswith(self, __suffix: Text | tuple[Text, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> str: ...
|
||||
def find(self, sub: Text, __start: int | None = ..., __end: int | None = ...) -> int: ...
|
||||
def format(self, *args: object, **kwargs: object) -> str: ...
|
||||
@@ -385,35 +379,35 @@ class str(Sequence[str], basestring):
|
||||
@overload
|
||||
def lstrip(self, __chars: unicode) -> unicode: ...
|
||||
@overload
|
||||
def partition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ...
|
||||
def partition(self, __sep: bytearray) -> tuple[str, bytearray, str]: ...
|
||||
@overload
|
||||
def partition(self, __sep: str) -> Tuple[str, str, str]: ...
|
||||
def partition(self, __sep: str) -> tuple[str, str, str]: ...
|
||||
@overload
|
||||
def partition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def partition(self, __sep: unicode) -> tuple[unicode, unicode, unicode]: ...
|
||||
def replace(self, __old: AnyStr, __new: AnyStr, __count: int = ...) -> AnyStr: ...
|
||||
def rfind(self, sub: Text, __start: int | None = ..., __end: int | None = ...) -> int: ...
|
||||
def rindex(self, sub: Text, __start: int | None = ..., __end: int | None = ...) -> int: ...
|
||||
def rjust(self, __width: int, __fillchar: str = ...) -> str: ...
|
||||
@overload
|
||||
def rpartition(self, __sep: bytearray) -> Tuple[str, bytearray, str]: ...
|
||||
def rpartition(self, __sep: bytearray) -> tuple[str, bytearray, str]: ...
|
||||
@overload
|
||||
def rpartition(self, __sep: str) -> Tuple[str, str, str]: ...
|
||||
def rpartition(self, __sep: str) -> tuple[str, str, str]: ...
|
||||
@overload
|
||||
def rpartition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def rpartition(self, __sep: unicode) -> tuple[unicode, unicode, unicode]: ...
|
||||
@overload
|
||||
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> List[str]: ...
|
||||
def rsplit(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
@overload
|
||||
def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ...
|
||||
def rsplit(self, sep: unicode, maxsplit: int = ...) -> list[unicode]: ...
|
||||
@overload
|
||||
def rstrip(self, __chars: str = ...) -> str: ...
|
||||
@overload
|
||||
def rstrip(self, __chars: unicode) -> unicode: ...
|
||||
@overload
|
||||
def split(self, sep: str | None = ..., maxsplit: int = ...) -> List[str]: ...
|
||||
def split(self, sep: str | None = ..., maxsplit: int = ...) -> list[str]: ...
|
||||
@overload
|
||||
def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> List[str]: ...
|
||||
def startswith(self, __prefix: Text | Tuple[Text, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def split(self, sep: unicode, maxsplit: int = ...) -> list[unicode]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[str]: ...
|
||||
def startswith(self, __prefix: Text | tuple[Text, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
@overload
|
||||
def strip(self, __chars: str = ...) -> str: ...
|
||||
@overload
|
||||
@@ -441,7 +435,7 @@ class str(Sequence[str], basestring):
|
||||
def __repr__(self) -> str: ...
|
||||
def __rmul__(self, n: int) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __getnewargs__(self) -> Tuple[str]: ...
|
||||
def __getnewargs__(self) -> tuple[str]: ...
|
||||
def __getslice__(self, start: int, stop: int) -> str: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __int__(self) -> int: ...
|
||||
@@ -463,7 +457,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def center(self, __width: int, __fillchar: bytes = ...) -> bytearray: ...
|
||||
def count(self, __sub: str) -> int: ...
|
||||
def decode(self, encoding: Text = ..., errors: Text = ...) -> str: ...
|
||||
def endswith(self, __suffix: bytes | Tuple[bytes, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def endswith(self, __suffix: bytes | tuple[bytes, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = ...) -> bytearray: ...
|
||||
def extend(self, iterable: str | Iterable[int]) -> None: ...
|
||||
def find(self, __sub: str, __start: int = ..., __end: int = ...) -> int: ...
|
||||
@@ -480,17 +474,17 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def ljust(self, __width: int, __fillchar: str = ...) -> bytearray: ...
|
||||
def lower(self) -> bytearray: ...
|
||||
def lstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
|
||||
def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def partition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
|
||||
def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytearray: ...
|
||||
def rfind(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ...
|
||||
def rindex(self, __sub: bytes, __start: int = ..., __end: int = ...) -> int: ...
|
||||
def rjust(self, __width: int, __fillchar: bytes = ...) -> bytearray: ...
|
||||
def rpartition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def rsplit(self, sep: bytes | None = ..., maxsplit: int = ...) -> List[bytearray]: ...
|
||||
def rpartition(self, __sep: bytes) -> tuple[bytearray, bytearray, bytearray]: ...
|
||||
def rsplit(self, sep: bytes | None = ..., maxsplit: int = ...) -> list[bytearray]: ...
|
||||
def rstrip(self, __bytes: bytes | None = ...) -> bytearray: ...
|
||||
def split(self, sep: bytes | None = ..., maxsplit: int = ...) -> List[bytearray]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> List[bytearray]: ...
|
||||
def startswith(self, __prefix: bytes | Tuple[bytes, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def split(self, sep: bytes | None = ..., maxsplit: int = ...) -> list[bytearray]: ...
|
||||
def splitlines(self, keepends: bool = ...) -> list[bytearray]: ...
|
||||
def startswith(self, __prefix: bytes | tuple[bytes, ...], __start: int | None = ..., __end: int | None = ...) -> bool: ...
|
||||
def strip(self, __bytes: bytes | None = ...) -> bytearray: ...
|
||||
def swapcase(self) -> bytearray: ...
|
||||
def title(self) -> bytearray: ...
|
||||
@@ -532,9 +526,9 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
class memoryview(Sized, Container[str]):
|
||||
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
|
||||
def __init__(self, obj: ReadableBuffer) -> None: ...
|
||||
@@ -550,11 +544,11 @@ class memoryview(Sized, Container[str]):
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: int) -> None: ...
|
||||
def tobytes(self) -> bytes: ...
|
||||
def tolist(self) -> List[int]: ...
|
||||
def tolist(self) -> list[int]: ...
|
||||
|
||||
@final
|
||||
class bool(int):
|
||||
def __new__(cls: Type[_T], __o: object = ...) -> _T: ...
|
||||
def __new__(cls: type[_T], __o: object = ...) -> _T: ...
|
||||
@overload
|
||||
def __and__(self, x: bool) -> bool: ...
|
||||
@overload
|
||||
@@ -579,7 +573,7 @@ class bool(int):
|
||||
def __rxor__(self, x: bool) -> bool: ...
|
||||
@overload
|
||||
def __rxor__(self, x: int) -> int: ...
|
||||
def __getnewargs__(self) -> Tuple[int]: ...
|
||||
def __getnewargs__(self) -> tuple[int]: ...
|
||||
|
||||
class slice(object):
|
||||
start: Any
|
||||
@@ -590,27 +584,27 @@ class slice(object):
|
||||
@overload
|
||||
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
|
||||
__hash__: None # type: ignore
|
||||
def indices(self, len: int) -> Tuple[int, int, int]: ...
|
||||
def indices(self, len: int) -> tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ...
|
||||
def __new__(cls: type[_T], iterable: Iterable[_T_co] = ...) -> _T: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, x: object) -> bool: ...
|
||||
@overload
|
||||
def __getitem__(self, x: int) -> _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[Any, ...]) -> Tuple[Any, ...]: ...
|
||||
def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def __add__(self, x: tuple[Any, ...]) -> tuple[Any, ...]: ...
|
||||
def __mul__(self, n: int) -> tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, n: int) -> tuple[_T_co, ...]: ...
|
||||
def count(self, __value: Any) -> int: ...
|
||||
def index(self, __value: Any) -> int: ...
|
||||
|
||||
@@ -641,25 +635,25 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> List[_T]: ...
|
||||
def __getitem__(self, s: slice) -> list[_T]: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: Iterable[_T]) -> None: ...
|
||||
def __delitem__(self, i: int | slice) -> None: ...
|
||||
def __getslice__(self, start: int, stop: int) -> List[_T]: ...
|
||||
def __getslice__(self, start: int, stop: int) -> list[_T]: ...
|
||||
def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ...
|
||||
def __delslice__(self, start: int, stop: int) -> None: ...
|
||||
def __add__(self, x: List[_T]) -> List[_T]: ...
|
||||
def __add__(self, x: list[_T]) -> list[_T]: ...
|
||||
def __iadd__(self: Self, x: Iterable[_T]) -> Self: ...
|
||||
def __mul__(self, n: int) -> List[_T]: ...
|
||||
def __rmul__(self, n: int) -> List[_T]: ...
|
||||
def __mul__(self, n: int) -> list[_T]: ...
|
||||
def __rmul__(self, n: int) -> list[_T]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __gt__(self, x: List[_T]) -> bool: ...
|
||||
def __ge__(self, x: List[_T]) -> bool: ...
|
||||
def __lt__(self, x: List[_T]) -> bool: ...
|
||||
def __le__(self, x: List[_T]) -> bool: ...
|
||||
def __gt__(self, x: list[_T]) -> bool: ...
|
||||
def __ge__(self, x: list[_T]) -> bool: ...
|
||||
def __lt__(self, x: list[_T]) -> bool: ...
|
||||
def __le__(self, x: list[_T]) -> bool: ...
|
||||
|
||||
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
# NOTE: Keyword arguments are special. If they are used, _KT must include
|
||||
@@ -669,31 +663,31 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __new__(cls: Type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
|
||||
def __init__(self, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __new__(cls: type[_T1], *args: Any, **kwargs: Any) -> _T1: ...
|
||||
def has_key(self, k: _KT) -> bool: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> Dict[_KT, _VT]: ...
|
||||
def popitem(self) -> Tuple[_KT, _VT]: ...
|
||||
def copy(self) -> dict[_KT, _VT]: ...
|
||||
def popitem(self) -> tuple[_KT, _VT]: ...
|
||||
def setdefault(self, __key: _KT, __default: _VT = ...) -> _VT: ...
|
||||
@overload
|
||||
def update(self, __m: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def update(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def update(self, **kwargs: _VT) -> None: ...
|
||||
def iterkeys(self) -> Iterator[_KT]: ...
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
def iteritems(self) -> Iterator[tuple[_KT, _VT]]: ...
|
||||
def viewkeys(self) -> KeysView[_KT]: ...
|
||||
def viewvalues(self) -> ValuesView[_VT]: ...
|
||||
def viewitems(self) -> ItemsView[_KT, _VT]: ...
|
||||
@classmethod
|
||||
@overload
|
||||
def fromkeys(cls, __iterable: Iterable[_T]) -> Dict[_T, Any]: ...
|
||||
def fromkeys(cls, __iterable: Iterable[_T]) -> dict[_T, Any]: ...
|
||||
@classmethod
|
||||
@overload
|
||||
def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> Dict[_T, _S]: ...
|
||||
def fromkeys(cls, __iterable: Iterable[_T], __value: _S) -> dict[_T, _S]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
@@ -706,39 +700,39 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
|
||||
def add(self, element: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> Set[_T]: ...
|
||||
def difference(self, *s: Iterable[Any]) -> Set[_T]: ...
|
||||
def copy(self) -> set[_T]: ...
|
||||
def difference(self, *s: Iterable[Any]) -> set[_T]: ...
|
||||
def difference_update(self, *s: Iterable[Any]) -> None: ...
|
||||
def discard(self, element: _T) -> None: ...
|
||||
def intersection(self, *s: Iterable[Any]) -> Set[_T]: ...
|
||||
def intersection(self, *s: Iterable[Any]) -> set[_T]: ...
|
||||
def intersection_update(self, *s: Iterable[Any]) -> None: ...
|
||||
def isdisjoint(self, s: Iterable[Any]) -> bool: ...
|
||||
def issubset(self, s: Iterable[Any]) -> bool: ...
|
||||
def issuperset(self, s: Iterable[Any]) -> bool: ...
|
||||
def pop(self) -> _T: ...
|
||||
def remove(self, element: _T) -> None: ...
|
||||
def symmetric_difference(self, s: Iterable[_T]) -> Set[_T]: ...
|
||||
def symmetric_difference(self, s: Iterable[_T]) -> set[_T]: ...
|
||||
def symmetric_difference_update(self, s: Iterable[_T]) -> None: ...
|
||||
def union(self, *s: Iterable[_T]) -> Set[_T]: ...
|
||||
def union(self, *s: Iterable[_T]) -> set[_T]: ...
|
||||
def update(self, *s: Iterable[_T]) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __and__(self, s: AbstractSet[object]) -> Set[_T]: ...
|
||||
def __iand__(self, s: AbstractSet[object]) -> Set[_T]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> Set[_T | _S]: ...
|
||||
def __ior__(self, s: AbstractSet[_S]) -> Set[_T | _S]: ...
|
||||
def __and__(self, s: AbstractSet[object]) -> set[_T]: ...
|
||||
def __iand__(self, s: AbstractSet[object]) -> set[_T]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> set[_T | _S]: ...
|
||||
def __ior__(self, s: AbstractSet[_S]) -> set[_T | _S]: ...
|
||||
@overload
|
||||
def __sub__(self: Set[str], s: AbstractSet[Text | None]) -> Set[_T]: ...
|
||||
def __sub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ...
|
||||
@overload
|
||||
def __sub__(self, s: AbstractSet[_T | None]) -> Set[_T]: ...
|
||||
def __sub__(self, s: AbstractSet[_T | None]) -> set[_T]: ...
|
||||
@overload # type: ignore
|
||||
def __isub__(self: Set[str], s: AbstractSet[Text | None]) -> Set[_T]: ...
|
||||
def __isub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ...
|
||||
@overload
|
||||
def __isub__(self, s: AbstractSet[_T | None]) -> Set[_T]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> Set[_T | _S]: ...
|
||||
def __ixor__(self, s: AbstractSet[_S]) -> Set[_T | _S]: ...
|
||||
def __isub__(self, s: AbstractSet[_T | None]) -> set[_T]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> set[_T | _S]: ...
|
||||
def __ixor__(self, s: AbstractSet[_S]) -> set[_T | _S]: ...
|
||||
def __le__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __lt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[object]) -> bool: ...
|
||||
@@ -747,31 +741,31 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
|
||||
class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
|
||||
def copy(self) -> FrozenSet[_T_co]: ...
|
||||
def difference(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ...
|
||||
def intersection(self, *s: Iterable[object]) -> FrozenSet[_T_co]: ...
|
||||
def copy(self) -> frozenset[_T_co]: ...
|
||||
def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: ...
|
||||
def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]: ...
|
||||
def isdisjoint(self, s: Iterable[_T_co]) -> bool: ...
|
||||
def issubset(self, s: Iterable[object]) -> bool: ...
|
||||
def issuperset(self, s: Iterable[object]) -> bool: ...
|
||||
def symmetric_difference(self, s: Iterable[_T_co]) -> FrozenSet[_T_co]: ...
|
||||
def union(self, *s: Iterable[_T_co]) -> FrozenSet[_T_co]: ...
|
||||
def symmetric_difference(self, s: Iterable[_T_co]) -> frozenset[_T_co]: ...
|
||||
def union(self, *s: Iterable[_T_co]) -> frozenset[_T_co]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __and__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> FrozenSet[_T_co | _S]: ...
|
||||
def __sub__(self, s: AbstractSet[_T_co]) -> FrozenSet[_T_co]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> FrozenSet[_T_co | _S]: ...
|
||||
def __and__(self, s: AbstractSet[_T_co]) -> frozenset[_T_co]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ...
|
||||
def __sub__(self, s: AbstractSet[_T_co]) -> frozenset[_T_co]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> frozenset[_T_co | _S]: ...
|
||||
def __le__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __lt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
|
||||
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]: ...
|
||||
def __iter__(self) -> Iterator[tuple[int, _T]]: ...
|
||||
def next(self) -> tuple[int, _T]: ...
|
||||
|
||||
class xrange(Sized, Iterable[int], Reversible[int]):
|
||||
@overload
|
||||
@@ -821,29 +815,29 @@ def cmp(__x: Any, __y: Any) -> int: ...
|
||||
|
||||
_N1 = TypeVar("_N1", bool, int, float, complex)
|
||||
|
||||
def coerce(__x: _N1, __y: _N1) -> Tuple[_N1, _N1]: ...
|
||||
def coerce(__x: _N1, __y: _N1) -> tuple[_N1, _N1]: ...
|
||||
def compile(source: Text | mod, filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ...
|
||||
def delattr(__obj: Any, __name: Text) -> None: ...
|
||||
def dir(__o: object = ...) -> List[str]: ...
|
||||
def dir(__o: object = ...) -> list[str]: ...
|
||||
|
||||
_N2 = TypeVar("_N2", int, float)
|
||||
|
||||
def divmod(__x: _N2, __y: _N2) -> Tuple[_N2, _N2]: ...
|
||||
def divmod(__x: _N2, __y: _N2) -> tuple[_N2, _N2]: ...
|
||||
def eval(
|
||||
__source: Text | bytes | CodeType, __globals: Dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
|
||||
__source: Text | bytes | CodeType, __globals: dict[str, Any] | None = ..., __locals: Mapping[str, Any] | None = ...
|
||||
) -> Any: ...
|
||||
def execfile(__filename: str, __globals: Dict[str, Any] | None = ..., __locals: Dict[str, Any] | None = ...) -> None: ...
|
||||
def execfile(__filename: str, __globals: dict[str, Any] | None = ..., __locals: dict[str, Any] | None = ...) -> None: ...
|
||||
def exit(code: object = ...) -> NoReturn: ...
|
||||
@overload
|
||||
def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore
|
||||
@overload
|
||||
def filter(__function: None, __iterable: Tuple[_T | None, ...]) -> Tuple[_T, ...]: ... # type: ignore
|
||||
def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... # type: ignore
|
||||
@overload
|
||||
def filter(__function: Callable[[_T], Any], __iterable: Tuple[_T, ...]) -> Tuple[_T, ...]: ... # type: ignore
|
||||
def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... # type: ignore
|
||||
@overload
|
||||
def filter(__function: None, __iterable: Iterable[_T | None]) -> List[_T]: ...
|
||||
def filter(__function: None, __iterable: Iterable[_T | None]) -> list[_T]: ...
|
||||
@overload
|
||||
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> List[_T]: ...
|
||||
def filter(__function: Callable[[_T], Any], __iterable: Iterable[_T]) -> list[_T]: ...
|
||||
def format(__value: object, __format_spec: str = ...) -> str: ... # TODO unicode
|
||||
@overload
|
||||
def getattr(__o: Any, name: Text) -> Any: ...
|
||||
@@ -861,7 +855,7 @@ def getattr(__o: object, name: str, __default: list[Any]) -> Any | list[Any]: ..
|
||||
def getattr(__o: object, name: str, __default: dict[Any, Any]) -> Any | dict[Any, Any]: ...
|
||||
@overload
|
||||
def getattr(__o: Any, name: Text, __default: _T) -> Any | _T: ...
|
||||
def globals() -> Dict[str, Any]: ...
|
||||
def globals() -> dict[str, Any]: ...
|
||||
def hasattr(__obj: Any, __name: Text) -> bool: ...
|
||||
def hash(__obj: object) -> int: ...
|
||||
def hex(__number: int | _SupportsIndex) -> str: ...
|
||||
@@ -874,20 +868,20 @@ def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def iter(__function: Callable[[], _T], __sentinel: Any) -> Iterator[_T]: ...
|
||||
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 locals() -> Dict[str, Any]: ...
|
||||
def locals() -> dict[str, Any]: ...
|
||||
@overload
|
||||
def map(__func: None, __iter1: Iterable[_T1]) -> List[_T1]: ...
|
||||
def map(__func: None, __iter1: Iterable[_T1]) -> list[_T1]: ...
|
||||
@overload
|
||||
def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ...
|
||||
def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> list[tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
def map(__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> list[tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: None, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
|
||||
) -> List[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
) -> list[tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: None,
|
||||
@@ -896,7 +890,7 @@ def map(
|
||||
__iter3: Iterable[_T3],
|
||||
__iter4: Iterable[_T4],
|
||||
__iter5: Iterable[_T5],
|
||||
) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
) -> list[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: None,
|
||||
@@ -907,15 +901,15 @@ def map(
|
||||
__iter5: Iterable[Any],
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> List[Tuple[Any, ...]]: ...
|
||||
) -> list[tuple[Any, ...]]: ...
|
||||
@overload
|
||||
def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> List[_S]: ...
|
||||
def map(__func: Callable[[_T1], _S], __iter1: Iterable[_T1]) -> list[_S]: ...
|
||||
@overload
|
||||
def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[_S]: ...
|
||||
def map(__func: Callable[[_T1, _T2], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> list[_S]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: Callable[[_T1, _T2, _T3], _S], __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]
|
||||
) -> List[_S]: ...
|
||||
) -> list[_S]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: Callable[[_T1, _T2, _T3, _T4], _S],
|
||||
@@ -923,7 +917,7 @@ def map(
|
||||
__iter2: Iterable[_T2],
|
||||
__iter3: Iterable[_T3],
|
||||
__iter4: Iterable[_T4],
|
||||
) -> List[_S]: ...
|
||||
) -> list[_S]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: Callable[[_T1, _T2, _T3, _T4, _T5], _S],
|
||||
@@ -932,7 +926,7 @@ def map(
|
||||
__iter3: Iterable[_T3],
|
||||
__iter4: Iterable[_T4],
|
||||
__iter5: Iterable[_T5],
|
||||
) -> List[_S]: ...
|
||||
) -> list[_S]: ...
|
||||
@overload
|
||||
def map(
|
||||
__func: Callable[..., _S],
|
||||
@@ -943,7 +937,7 @@ def map(
|
||||
__iter5: Iterable[Any],
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> List[_S]: ...
|
||||
) -> list[_S]: ...
|
||||
@overload
|
||||
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
|
||||
@overload
|
||||
@@ -983,7 +977,7 @@ def pow(__base: _SupportsPow2[_E, _T_co], __exp: _E) -> _T_co: ...
|
||||
@overload
|
||||
def pow(__base: _SupportsPow3[_E, _M, _T_co], __exp: _E, __mod: _M) -> _T_co: ...
|
||||
def quit(code: object = ...) -> NoReturn: ...
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> List[int]: ... # noqa: F811
|
||||
def range(__x: int, __y: int = ..., __step: int = ...) -> list[int]: ... # noqa: F811
|
||||
def raw_input(__prompt: Any = ...) -> str: ...
|
||||
@overload
|
||||
def reduce(__function: Callable[[_T, _S], _T], __iterable: Iterable[_S], __initializer: _T) -> _T: ...
|
||||
@@ -1006,27 +1000,27 @@ def round(number: SupportsFloat, ndigits: int) -> float: ...
|
||||
def setattr(__obj: Any, __name: Text, __value: Any) -> None: ...
|
||||
def sorted(
|
||||
__iterable: Iterable[_T], *, cmp: Callable[[_T, _T], int] = ..., key: Callable[[_T], Any] | None = ..., reverse: bool = ...
|
||||
) -> List[_T]: ...
|
||||
) -> list[_T]: ...
|
||||
@overload
|
||||
def sum(__iterable: Iterable[_T]) -> _T | int: ...
|
||||
@overload
|
||||
def sum(__iterable: Iterable[_T], __start: _S) -> _T | _S: ...
|
||||
def unichr(__i: int) -> unicode: ...
|
||||
def vars(__object: Any = ...) -> Dict[str, Any]: ...
|
||||
def vars(__object: Any = ...) -> dict[str, Any]: ...
|
||||
@overload
|
||||
def zip(__iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ...
|
||||
def zip(__iter1: Iterable[_T1]) -> list[tuple[_T1]]: ...
|
||||
@overload
|
||||
def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ...
|
||||
def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> list[tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
def zip(__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> list[tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(
|
||||
__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]
|
||||
) -> List[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
) -> list[tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def zip(
|
||||
__iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], __iter5: Iterable[_T5]
|
||||
) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
) -> list[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def zip(
|
||||
__iter1: Iterable[Any],
|
||||
@@ -1036,7 +1030,7 @@ def zip(
|
||||
__iter5: Iterable[Any],
|
||||
__iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any],
|
||||
) -> List[Tuple[Any, ...]]: ...
|
||||
) -> list[tuple[Any, ...]]: ...
|
||||
def __import__(
|
||||
name: Text,
|
||||
globals: Mapping[str, Any] | None = ...,
|
||||
@@ -1064,13 +1058,13 @@ class buffer(Sized):
|
||||
def __mul__(self, x: int) -> str: ...
|
||||
|
||||
class BaseException(object):
|
||||
args: Tuple[Any, ...]
|
||||
args: tuple[Any, ...]
|
||||
message: Any
|
||||
def __init__(self, *args: object) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ...
|
||||
def __getslice__(self, start: int, stop: int) -> tuple[Any, ...]: ...
|
||||
|
||||
class GeneratorExit(BaseException): ...
|
||||
class KeyboardInterrupt(BaseException): ...
|
||||
@@ -1179,7 +1173,7 @@ class file(BinaryIO):
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def tell(self) -> int: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def readlines(self, hint: int = ...) -> list[str]: ...
|
||||
def write(self, data: str) -> int: ...
|
||||
def writelines(self, data: Iterable[str]) -> None: ...
|
||||
def truncate(self, pos: int | None = ...) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user