Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions
+5 -5
View File
@@ -1,14 +1,14 @@
import mimetools
import SocketServer
from typing import Any, BinaryIO, Callable, Mapping, Tuple
from typing import Any, BinaryIO, Callable, Mapping
class HTTPServer(SocketServer.TCPServer):
server_name: str
server_port: int
def __init__(self, server_address: Tuple[str, int], RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ...
def __init__(self, server_address: tuple[str, int], RequestHandlerClass: Callable[..., BaseHTTPRequestHandler]) -> None: ...
class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
client_address: Tuple[str, int]
client_address: tuple[str, int]
server: SocketServer.BaseServer
close_connection: bool
command: str
@@ -23,8 +23,8 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
error_content_type: str
protocol_version: str
MessageClass: type
responses: Mapping[int, Tuple[str, str]]
def __init__(self, request: bytes, client_address: Tuple[str, int], server: SocketServer.BaseServer) -> None: ...
responses: Mapping[int, tuple[str, str]]
def __init__(self, request: bytes, client_address: tuple[str, int], server: SocketServer.BaseServer) -> None: ...
def handle(self) -> None: ...
def handle_one_request(self) -> None: ...
def send_error(self, code: int, message: str | None = ...) -> None: ...
+1 -2
View File
@@ -1,6 +1,5 @@
import SimpleHTTPServer
from typing import List
class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
cgi_directories: List[str]
cgi_directories: list[str]
def do_POST(self) -> None: ...
+14 -14
View File
@@ -1,5 +1,5 @@
from _typeshed import SupportsNoArgReadline
from typing import IO, Any, Dict, List, Sequence, Tuple
from typing import IO, Any, Sequence
DEFAULTSECT: str
MAX_INTERPOLATION_DEPTH: int
@@ -42,7 +42,7 @@ class InterpolationDepthError(InterpolationError):
class ParsingError(Error):
filename: str
errors: List[Tuple[Any, Any]]
errors: list[tuple[Any, Any]]
def __init__(self, filename: str) -> None: ...
def append(self, lineno: Any, line: Any) -> None: ...
@@ -53,26 +53,26 @@ class MissingSectionHeaderError(ParsingError):
class RawConfigParser:
_dict: Any
_sections: Dict[Any, Any]
_defaults: Dict[Any, Any]
_sections: dict[Any, Any]
_defaults: dict[Any, Any]
_optcre: Any
SECTCRE: Any
OPTCRE: Any
OPTCRE_NV: Any
def __init__(self, defaults: Dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> Dict[Any, Any]: ...
def sections(self) -> List[str]: ...
def __init__(self, defaults: dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> dict[Any, Any]: ...
def sections(self) -> list[str]: ...
def add_section(self, section: str) -> None: ...
def has_section(self, section: str) -> bool: ...
def options(self, section: str) -> List[str]: ...
def read(self, filenames: str | Sequence[str]) -> List[str]: ...
def options(self, section: str) -> list[str]: ...
def read(self, filenames: str | Sequence[str]) -> list[str]: ...
def readfp(self, fp: SupportsNoArgReadline[str], filename: str = ...) -> None: ...
def get(self, section: str, option: str) -> str: ...
def items(self, section: str) -> List[Tuple[Any, Any]]: ...
def items(self, section: str) -> list[tuple[Any, Any]]: ...
def _get(self, section: str, conv: type, option: str) -> Any: ...
def getint(self, section: str, option: str) -> int: ...
def getfloat(self, section: str, option: str) -> float: ...
_boolean_states: Dict[str, bool]
_boolean_states: dict[str, bool]
def getboolean(self, section: str, option: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...
def has_option(self, section: str, option: str) -> bool: ...
@@ -84,8 +84,8 @@ class RawConfigParser:
class ConfigParser(RawConfigParser):
_KEYCRE: Any
def get(self, section: str, option: str, raw: bool = ..., vars: Dict[Any, Any] | None = ...) -> Any: ...
def items(self, section: str, raw: bool = ..., vars: Dict[Any, Any] | None = ...) -> List[Tuple[str, Any]]: ...
def get(self, section: str, option: str, raw: bool = ..., vars: dict[Any, Any] | None = ...) -> Any: ...
def items(self, section: str, raw: bool = ..., vars: dict[Any, Any] | None = ...) -> list[tuple[str, Any]]: ...
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolation_replace(self, match: Any) -> str: ...
@@ -93,5 +93,5 @@ class SafeConfigParser(ConfigParser):
_interpvar_re: Any
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolate_some(
self, option: str, accum: List[Any], rest: str, section: str, map: Dict[Any, Any], depth: int
self, option: str, accum: list[Any], rest: str, section: str, map: dict[Any, Any], depth: int
) -> None: ...
+3 -3
View File
@@ -1,8 +1,8 @@
from typing import Any, Dict
from typing import Any
class CookieError(Exception): ...
class Morsel(Dict[Any, Any]):
class Morsel(dict[Any, Any]):
key: Any
def __init__(self): ...
def __setitem__(self, K, V): ...
@@ -14,7 +14,7 @@ class Morsel(Dict[Any, Any]):
def js_output(self, attrs: Any | None = ...): ...
def OutputString(self, attrs: Any | None = ...): ...
class BaseCookie(Dict[Any, Any]):
class BaseCookie(dict[Any, Any]):
def value_decode(self, val): ...
def value_encode(self, val): ...
def __init__(self, input: Any | None = ...): ...
+3 -3
View File
@@ -1,4 +1,4 @@
from typing import AnyStr, List, Tuple
from typing import AnyStr
from markupbase import ParserBase
@@ -10,8 +10,8 @@ class HTMLParser(ParserBase):
def get_starttag_text(self) -> AnyStr: ...
def set_cdata_mode(self, AnyStr) -> None: ...
def clear_cdata_mode(self) -> None: ...
def handle_startendtag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ...
def handle_starttag(self, tag: AnyStr, attrs: List[Tuple[AnyStr, AnyStr]]): ...
def handle_startendtag(self, tag: AnyStr, attrs: list[tuple[AnyStr, AnyStr]]): ...
def handle_starttag(self, tag: AnyStr, attrs: list[tuple[AnyStr, AnyStr]]): ...
def handle_endtag(self, tag: AnyStr): ...
def handle_charref(self, name: AnyStr): ...
def handle_entityref(self, name: AnyStr): ...
+3 -2
View File
@@ -1,4 +1,5 @@
from typing import Any, Deque, Generic, TypeVar
from collections import deque
from typing import Any, Generic, TypeVar
_T = TypeVar("_T")
@@ -12,7 +13,7 @@ class Queue(Generic[_T]):
not_full: Any
all_tasks_done: Any
unfinished_tasks: Any
queue: Deque[Any] # undocumented
queue: deque[Any] # undocumented
def __init__(self, maxsize: int = ...) -> None: ...
def task_done(self) -> None: ...
def join(self) -> None: ...
+13 -13
View File
@@ -1,11 +1,11 @@
import sys
from socket import SocketType
from typing import Any, BinaryIO, Callable, ClassVar, List, Text, Tuple, Union
from typing import Any, BinaryIO, Callable, ClassVar, Text, Union
class BaseServer:
address_family: int
RequestHandlerClass: Callable[..., BaseRequestHandler]
server_address: Tuple[str, int]
server_address: tuple[str, int]
socket: SocketType
allow_reuse_address: bool
request_queue_size: int
@@ -17,19 +17,19 @@ class BaseServer:
def serve_forever(self, poll_interval: float = ...) -> None: ...
def shutdown(self) -> None: ...
def server_close(self) -> None: ...
def finish_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
def get_request(self) -> Tuple[SocketType, Tuple[str, int]]: ...
def handle_error(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
def finish_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
def get_request(self) -> tuple[SocketType, tuple[str, int]]: ...
def handle_error(self, request: bytes, client_address: tuple[str, int]) -> None: ...
def handle_timeout(self) -> None: ...
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
def server_activate(self) -> None: ...
def server_bind(self) -> None: ...
def verify_request(self, request: bytes, client_address: Tuple[str, int]) -> bool: ...
def verify_request(self, request: bytes, client_address: tuple[str, int]) -> bool: ...
class TCPServer(BaseServer):
def __init__(
self,
server_address: Tuple[str, int],
server_address: tuple[str, int],
RequestHandlerClass: Callable[..., BaseRequestHandler],
bind_and_activate: bool = ...,
) -> None: ...
@@ -37,7 +37,7 @@ class TCPServer(BaseServer):
class UDPServer(BaseServer):
def __init__(
self,
server_address: Tuple[str, int],
server_address: tuple[str, int],
RequestHandlerClass: Callable[..., BaseRequestHandler],
bind_and_activate: bool = ...,
) -> None: ...
@@ -61,16 +61,16 @@ if sys.platform != "win32":
if sys.platform != "win32":
class ForkingMixIn:
timeout: float | None # undocumented
active_children: List[int] | None # undocumented
active_children: list[int] | None # undocumented
max_children: int # undocumented
def collect_children(self) -> None: ... # undocumented
def handle_timeout(self) -> None: ... # undocumented
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
class ThreadingMixIn:
daemon_threads: bool
def process_request_thread(self, request: bytes, client_address: Tuple[str, int]) -> None: ... # undocumented
def process_request(self, request: bytes, client_address: Tuple[str, int]) -> None: ...
def process_request_thread(self, request: bytes, client_address: tuple[str, int]) -> None: ... # undocumented
def process_request(self, request: bytes, client_address: tuple[str, int]) -> None: ...
if sys.platform != "win32":
class ForkingTCPServer(ForkingMixIn, TCPServer): ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import IO, Any, AnyStr, Generic, Iterable, Iterator, List
from typing import IO, Any, AnyStr, Generic, Iterable, Iterator
class StringIO(IO[AnyStr], Generic[AnyStr]):
closed: bool
@@ -14,7 +14,7 @@ class StringIO(IO[AnyStr], Generic[AnyStr]):
def tell(self) -> int: ...
def read(self, n: int = ...) -> AnyStr: ...
def readline(self, length: int = ...) -> AnyStr: ...
def readlines(self, sizehint: int = ...) -> List[AnyStr]: ...
def readlines(self, sizehint: int = ...) -> list[AnyStr]: ...
def truncate(self, size: int | None = ...) -> int: ...
def write(self, s: AnyStr) -> int: ...
def writelines(self, iterable: Iterable[AnyStr]) -> None: ...
+8 -8
View File
@@ -1,11 +1,11 @@
from typing import Any, Container, Dict, Generic, Iterable, Iterator, List, Mapping, Sized, Tuple, TypeVar, overload
from typing import Any, Container, Generic, Iterable, Iterator, Mapping, Sized, TypeVar, overload
_KT = TypeVar("_KT")
_VT = TypeVar("_VT")
_T = TypeVar("_T")
class UserDict(Dict[_KT, _VT], Generic[_KT, _VT]):
data: Dict[_KT, _VT]
class UserDict(dict[_KT, _VT], Generic[_KT, _VT]):
data: dict[_KT, _VT]
def __init__(self, initialdata: Mapping[_KT, _VT] = ...) -> None: ...
# TODO: __iter__ is not available for UserDict
@@ -21,18 +21,18 @@ class DictMixin(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT]):
def get(self, k: _KT) -> _VT | None: ...
@overload
def get(self, k: _KT, default: _VT | _T) -> _VT | _T: ...
def values(self) -> List[_VT]: ...
def items(self) -> List[Tuple[_KT, _VT]]: ...
def values(self) -> list[_VT]: ...
def items(self) -> list[tuple[_KT, _VT]]: ...
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 __contains__(self, o: Any) -> bool: ...
# From typing.MutableMapping[_KT, _VT]
def clear(self) -> None: ...
def pop(self, k: _KT, default: _VT = ...) -> _VT: ...
def popitem(self) -> Tuple[_KT, _VT]: ...
def popitem(self) -> tuple[_KT, _VT]: ...
def setdefault(self, k: _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: ...
+2 -2
View File
@@ -1,10 +1,10 @@
from _typeshed import Self
from typing import Iterable, List, MutableSequence, TypeVar, overload
from typing import Iterable, MutableSequence, TypeVar, overload
_T = TypeVar("_T")
class UserList(MutableSequence[_T]):
data: List[_T]
data: list[_T]
def insert(self, index: int, object: _T) -> None: ...
@overload
def __setitem__(self, i: int, o: _T) -> None: ...
+8 -8
View File
@@ -1,5 +1,5 @@
from _typeshed import Self
from typing import Any, Iterable, List, MutableSequence, Sequence, Text, Tuple, TypeVar, overload
from typing import Any, Iterable, MutableSequence, Sequence, Text, TypeVar, overload
_MST = TypeVar("_MST", bound=MutableString)
@@ -26,7 +26,7 @@ class UserString(Sequence[UserString]):
def count(self, sub: int, start: int = ..., end: int = ...) -> int: ...
def decode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
def encode(self: Self, encoding: str | None = ..., errors: str | None = ...) -> Self: ...
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: Self, tabsize: int = ...) -> Self: ...
def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
def index(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
@@ -43,17 +43,17 @@ class UserString(Sequence[UserString]):
def ljust(self: Self, width: int, *args: Any) -> Self: ...
def lower(self: Self) -> Self: ...
def lstrip(self: Self, chars: Text | None = ...) -> Self: ...
def partition(self, sep: Text) -> Tuple[Text, Text, Text]: ...
def partition(self, sep: Text) -> tuple[Text, Text, Text]: ...
def replace(self: Self, old: Text, new: Text, maxsplit: int = ...) -> Self: ...
def rfind(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
def rindex(self, sub: Text, start: int = ..., end: int = ...) -> int: ...
def rjust(self: Self, width: int, *args: Any) -> Self: ...
def rpartition(self, sep: Text) -> Tuple[Text, Text, Text]: ...
def rpartition(self, sep: Text) -> tuple[Text, Text, Text]: ...
def rstrip(self: Self, chars: Text | None = ...) -> Self: ...
def split(self, sep: Text | None = ..., maxsplit: int = ...) -> List[Text]: ...
def rsplit(self, sep: Text | None = ..., maxsplit: int = ...) -> List[Text]: ...
def splitlines(self, keepends: int = ...) -> List[Text]: ...
def startswith(self, prefix: Text | Tuple[Text, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
def split(self, sep: Text | None = ..., maxsplit: int = ...) -> list[Text]: ...
def rsplit(self, sep: Text | None = ..., maxsplit: int = ...) -> list[Text]: ...
def splitlines(self, keepends: int = ...) -> list[Text]: ...
def startswith(self, prefix: Text | tuple[Text, ...], start: int | None = ..., end: int | None = ...) -> bool: ...
def strip(self: Self, chars: Text | None = ...) -> Self: ...
def swapcase(self: Self) -> Self: ...
def title(self: Self) -> Self: ...
+156 -162
View File
@@ -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: ...
+1 -2
View File
@@ -1,5 +1,4 @@
import sys
from typing import List
class _Feature:
def __init__(self, optionalRelease: sys._version_info, mandatoryRelease: sys._version_info, compiler_flag: int) -> None: ...
@@ -14,4 +13,4 @@ nested_scopes: _Feature
print_function: _Feature
unicode_literals: _Feature
with_statement: _Feature
all_feature_names: List[str] # undocumented
all_feature_names: list[str] # undocumented
+39 -39
View File
@@ -1,9 +1,9 @@
import codecs
import sys
from typing import Any, Callable, Dict, Text, Tuple, Union
from typing import Any, Callable, Text, Union
# For convenience:
_Handler = Callable[[Exception], Tuple[Text, int]]
_Handler = Callable[[Exception], tuple[Text, int]]
_String = Union[bytes, str]
_Errors = Union[str, Text, None]
_Decodable = Union[bytes, Text]
@@ -13,7 +13,7 @@ _Encodable = Union[bytes, Text]
class _EncodingMap(object):
def size(self) -> int: ...
_MapT = Union[Dict[int, int], _EncodingMap]
_MapT = Union[dict[int, int], _EncodingMap]
def register(__search_function: Callable[[str], Any]) -> None: ...
def register_error(__errors: str | Text, __handler: _Handler) -> None: ...
@@ -22,45 +22,45 @@ def lookup_error(__name: str | Text) -> _Handler: ...
def decode(obj: Any, encoding: str | Text = ..., errors: _Errors = ...) -> Any: ...
def encode(obj: Any, encoding: str | Text = ..., errors: _Errors = ...) -> Any: ...
def charmap_build(__map: Text) -> _MapT: ...
def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: _MapT | None = ...) -> Tuple[Text, int]: ...
def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: _MapT | None = ...) -> Tuple[bytes, int]: ...
def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def latin_1_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> tuple[Text, int]: ...
def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: _MapT | None = ...) -> tuple[Text, int]: ...
def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: _MapT | None = ...) -> tuple[bytes, int]: ...
def escape_decode(__data: _String, __errors: _Errors = ...) -> tuple[str, int]: ...
def escape_encode(__data: bytes, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def latin_1_decode(__data: _Decodable, __errors: _Errors = ...) -> tuple[Text, int]: ...
def latin_1_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def raw_unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> tuple[Text, int]: ...
def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> tuple[Text, int]: ...
def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> tuple[Text, int]: ...
def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
def utf_16_ex_decode(
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[Text, int, int]: ...
def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
) -> tuple[Text, int, int]: ...
def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
def utf_32_ex_decode(
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[Text, int, int]: ...
def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
) -> tuple[Text, int, int]: ...
def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
if sys.platform == "win32":
def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def mbcs_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> tuple[Text, int]: ...
def mbcs_encode(__str: _Encodable, __errors: _Errors = ...) -> tuple[bytes, int]: ...
+2 -2
View File
@@ -1,12 +1,12 @@
from _typeshed import Self
from typing import Any, Callable, Dict, Generic, Iterator, TypeVar
from typing import Any, Callable, Generic, Iterator, TypeVar
_K = TypeVar("_K")
_V = TypeVar("_V")
_T = TypeVar("_T")
_T2 = TypeVar("_T2")
class defaultdict(Dict[_K, _V]):
class defaultdict(dict[_K, _V]):
default_factory: None
def __init__(self, __default_factory: Callable[[], _V] = ..., init: Any = ...) -> None: ...
def __missing__(self, key: _K) -> _V: ...
+5 -5
View File
@@ -1,4 +1,4 @@
from typing import Any, Iterable, Iterator, List, Protocol, Sequence, Text, Type, Union
from typing import Any, Iterable, Iterator, Protocol, Sequence, Text, Union
QUOTE_ALL: int
QUOTE_MINIMAL: int
@@ -18,12 +18,12 @@ class Dialect:
strict: int
def __init__(self) -> None: ...
_DialectLike = Union[str, Dialect, Type[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]: ...
def next(self) -> list[str]: ...
class _writer:
dialect: Dialect
@@ -38,5 +38,5 @@ def reader(csvfile: Iterable[Text], dialect: _DialectLike = ..., **fmtparams: An
def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...
def unregister_dialect(name: str) -> None: ...
def get_dialect(name: str) -> Dialect: ...
def list_dialects() -> List[str]: ...
def list_dialects() -> list[str]: ...
def field_size_limit(new_limit: int = ...) -> int: ...
+11 -11
View File
@@ -1,4 +1,4 @@
from typing import IO, Any, BinaryIO, Tuple, Union, overload
from typing import IO, Any, BinaryIO, Union, overload
_chtype = Union[str, bytes, int]
@@ -263,7 +263,7 @@ def baudrate() -> int: ...
def beep() -> None: ...
def can_change_color() -> bool: ...
def cbreak(__flag: bool = ...) -> None: ...
def color_content(__color_number: int) -> Tuple[int, int, int]: ...
def color_content(__color_number: int) -> tuple[int, int, int]: ...
# Changed in Python 3.8.8 and 3.9.2
def color_pair(__color_number: int) -> int: ...
@@ -278,8 +278,8 @@ def erasechar() -> bytes: ...
def filter() -> None: ...
def flash() -> None: ...
def flushinp() -> None: ...
def getmouse() -> Tuple[int, int, int, int, int]: ...
def getsyx() -> Tuple[int, int]: ...
def getmouse() -> tuple[int, int, int, int, int]: ...
def getsyx() -> tuple[int, int]: ...
def getwin(__file: BinaryIO) -> _CursesWindow: ...
def halfdelay(__tenths: int) -> None: ...
def has_colors() -> bool: ...
@@ -297,7 +297,7 @@ def killchar() -> bytes: ...
def longname() -> bytes: ...
def meta(__yes: bool) -> None: ...
def mouseinterval(__interval: int) -> None: ...
def mousemask(__newmask: int) -> Tuple[int, int]: ...
def mousemask(__newmask: int) -> tuple[int, int]: ...
def napms(__ms: int) -> int: ...
def newpad(__nlines: int, __ncols: int) -> _CursesWindow: ...
def newwin(__nlines: int, __ncols: int, __begin_y: int = ..., __begin_x: int = ...) -> _CursesWindow: ...
@@ -307,7 +307,7 @@ def noecho() -> None: ...
def nonl() -> None: ...
def noqiflush() -> None: ...
def noraw() -> None: ...
def pair_content(__pair_number: int) -> Tuple[int, int]: ...
def pair_content(__pair_number: int) -> tuple[int, int]: ...
def pair_number(__attr: int) -> int: ...
def putp(__string: bytes) -> None: ...
def qiflush(__flag: bool = ...) -> None: ...
@@ -405,8 +405,8 @@ class _CursesWindow:
def echochar(self, __ch: _chtype, __attr: int = ...) -> None: ...
def enclose(self, __y: int, __x: int) -> bool: ...
def erase(self) -> None: ...
def getbegyx(self) -> Tuple[int, int]: ...
def getbkgd(self) -> Tuple[int, int]: ...
def getbegyx(self) -> tuple[int, int]: ...
def getbkgd(self) -> tuple[int, int]: ...
@overload
def getch(self) -> int: ...
@overload
@@ -415,8 +415,8 @@ class _CursesWindow:
def getkey(self) -> str: ...
@overload
def getkey(self, y: int, x: int) -> str: ...
def getmaxyx(self) -> Tuple[int, int]: ...
def getparyx(self) -> Tuple[int, int]: ...
def getmaxyx(self) -> tuple[int, int]: ...
def getparyx(self) -> tuple[int, int]: ...
@overload
def getstr(self) -> _chtype: ...
@overload
@@ -425,7 +425,7 @@ class _CursesWindow:
def getstr(self, y: int, x: int) -> _chtype: ...
@overload
def getstr(self, y: int, x: int, n: int) -> _chtype: ...
def getyx(self) -> Tuple[int, int]: ...
def getyx(self) -> tuple[int, int]: ...
@overload
def hline(self, ch: _chtype, n: int) -> None: ...
@overload
+7 -7
View File
@@ -1,18 +1,18 @@
from types import FrameType, TracebackType
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type
from typing import Any, Callable, Iterable, Mapping, Optional, Text
# TODO recursive type
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
__all__: List[str]
__all__: list[str]
def active_count() -> int: ...
def activeCount() -> int: ...
def current_thread() -> Thread: ...
def currentThread() -> Thread: ...
def enumerate() -> List[Thread]: ...
def enumerate() -> list[Thread]: ...
def settrace(func: _TF) -> None: ...
def setprofile(func: _PF | None) -> None: ...
def stack_size(size: int = ...) -> int: ...
@@ -52,7 +52,7 @@ class Lock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -62,7 +62,7 @@ class _RLock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -73,7 +73,7 @@ class Condition:
def __init__(self, lock: Lock | _RLock | None = ...) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
@@ -85,7 +85,7 @@ class Condition:
class Semaphore:
def __init__(self, value: int = ...) -> None: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def acquire(self, blocking: bool = ...) -> bool: ...
def __enter__(self, blocking: bool = ...) -> bool: ...
+3 -3
View File
@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar, overload
from typing import Any, Callable, Iterable, TypeVar, overload
_T = TypeVar("_T")
_S = TypeVar("_S")
@@ -10,7 +10,7 @@ def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T
class partial(object):
func: Callable[..., Any]
args: Tuple[Any, ...]
keywords: Dict[str, Any]
args: tuple[Any, ...]
keywords: dict[str, Any]
def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
+8 -8
View File
@@ -1,11 +1,11 @@
from typing import Any, Callable, Iterable, List, TypeVar
from typing import Any, Callable, Iterable, TypeVar
_T = TypeVar("_T")
def heapify(__heap: List[Any]) -> None: ...
def heappop(__heap: List[_T]) -> _T: ...
def heappush(__heap: List[_T], __item: _T) -> None: ...
def heappushpop(__heap: List[_T], __item: _T) -> _T: ...
def heapreplace(__heap: List[_T], __item: _T) -> _T: ...
def nlargest(__n: int, __iterable: Iterable[_T], __key: Callable[[_T], Any] | None = ...) -> List[_T]: ...
def nsmallest(__n: int, __iterable: Iterable[_T], __key: Callable[[_T], Any] | None = ...) -> List[_T]: ...
def heapify(__heap: list[Any]) -> None: ...
def heappop(__heap: list[_T]) -> _T: ...
def heappush(__heap: list[_T], __item: _T) -> None: ...
def heappushpop(__heap: list[_T], __item: _T) -> _T: ...
def heapreplace(__heap: list[_T], __item: _T) -> _T: ...
def nlargest(__n: int, __iterable: Iterable[_T], __key: Callable[[_T], Any] | None = ...) -> list[_T]: ...
def nsmallest(__n: int, __iterable: Iterable[_T], __key: Callable[[_T], Any] | None = ...) -> list[_T]: ...
+2 -2
View File
@@ -1,9 +1,9 @@
from typing import Any, Tuple
from typing import Any
def coverage(a: str) -> Any: ...
def logreader(a: str) -> LogReaderType: ...
def profiler(a: str, *args, **kwargs) -> Any: ...
def resolution() -> Tuple[Any, ...]: ...
def resolution() -> tuple[Any, ...]: ...
class LogReaderType(object):
def close(self) -> None: ...
+10 -10
View File
@@ -1,6 +1,6 @@
from _typeshed import Self
from mmap import mmap
from typing import IO, Any, BinaryIO, Iterable, List, Text, TextIO, Tuple, Type, Union
from typing import IO, Any, BinaryIO, Iterable, Text, TextIO, Union
_bytearray_like = Union[bytearray, mmap]
@@ -30,13 +30,13 @@ class _IOBase(BinaryIO):
def truncate(self, size: int | None = ...) -> int: ...
def writable(self) -> bool: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, t: Type[BaseException] | None, value: BaseException | None, traceback: Any | None) -> bool | None: ...
def __exit__(self, t: type[BaseException] | None, value: BaseException | None, traceback: Any | None) -> bool | None: ...
def __iter__(self: Self) -> Self: ...
# The parameter type of writelines[s]() is determined by that of write():
def writelines(self, lines: Iterable[bytes]) -> None: ...
# The return type of readline[s]() and next() is determined by that of read():
def readline(self, limit: int = ...) -> bytes: ...
def readlines(self, hint: int = ...) -> List[bytes]: ...
def readlines(self, hint: int = ...) -> list[bytes]: ...
def next(self) -> bytes: ...
# These don't actually exist but we need to pretend that it does
# so that this class is concrete.
@@ -77,8 +77,8 @@ class BufferedWriter(_BufferedIOBase):
class BytesIO(_BufferedIOBase):
def __init__(self, initial_bytes: bytes = ...) -> None: ...
def __setstate__(self, state: Tuple[Any, ...]) -> None: ...
def __getstate__(self) -> Tuple[Any, ...]: ...
def __setstate__(self, state: tuple[Any, ...]) -> None: ...
def __getstate__(self) -> tuple[Any, ...]: ...
# BytesIO does not contain a "name" field. This workaround is necessary
# to allow BytesIO sub-classes to add this field, as it is defined
# as a read-only property on IO[].
@@ -104,8 +104,8 @@ class IncrementalNewlineDecoder(object):
newlines: str | unicode
def __init__(self, decoder, translate, z=...) -> None: ...
def decode(self, input, final) -> Any: ...
def getstate(self) -> Tuple[Any, int]: ...
def setstate(self, state: Tuple[Any, int]) -> None: ...
def getstate(self) -> tuple[Any, int]: ...
def setstate(self, state: tuple[Any, int]) -> None: ...
def reset(self) -> None: ...
# Note: In the actual _io.py, _TextIOBase inherits from _IOBase.
@@ -138,14 +138,14 @@ class _TextIOBase(TextIO):
def write(self, pbuf: unicode) -> int: ...
def writelines(self, lines: Iterable[unicode]) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, t: Type[BaseException] | None, value: BaseException | None, traceback: Any | None) -> bool | None: ...
def __exit__(self, t: type[BaseException] | None, value: BaseException | None, traceback: Any | None) -> bool | None: ...
def __iter__(self: Self) -> Self: ...
class StringIO(_TextIOBase):
line_buffering: bool
def __init__(self, initial_value: unicode | None = ..., newline: unicode | None = ...) -> None: ...
def __setstate__(self, state: Tuple[Any, ...]) -> None: ...
def __getstate__(self) -> Tuple[Any, ...]: ...
def __setstate__(self, state: tuple[Any, ...]) -> None: ...
def __getstate__(self) -> tuple[Any, ...]: ...
# StringIO does not contain a "name" field. This workaround is necessary
# to allow StringIO sub-classes to add this field, as it is defined
# as a read-only property on IO[].
+2 -2
View File
@@ -1,7 +1,7 @@
from typing import Any, Tuple
from typing import Any
def encode_basestring_ascii(*args, **kwargs) -> str: ...
def scanstring(a, b, *args, **kwargs) -> Tuple[Any, ...]: ...
def scanstring(a, b, *args, **kwargs) -> tuple[Any, ...]: ...
class Encoder(object): ...
class Scanner(object): ...
+1 -3
View File
@@ -1,8 +1,6 @@
from typing import Tuple
class ParserBase:
def __init__(self) -> None: ...
def error(self, message: str) -> None: ...
def reset(self) -> None: ...
def getpos(self) -> Tuple[int, int]: ...
def getpos(self) -> tuple[int, int]: ...
def unknown_decl(self, data: str) -> None: ...
+1 -2
View File
@@ -1,5 +1,4 @@
import sys
from typing import List
if sys.platform == "win32":
@@ -44,6 +43,6 @@ if sys.platform == "win32":
__new__: None # type: ignore
__init__: None # type: ignore
def UuidCreate() -> str: ...
def FCICreate(cabname: str, files: List[str]) -> None: ...
def FCICreate(cabname: str, files: list[str]) -> None: ...
def OpenDatabase(name: str, flags: int) -> _Database: ...
def CreateRecord(count: int) -> _Record: ...
+16 -16
View File
@@ -1,13 +1,13 @@
from typing import Dict, Iterable, List, Sequence, Tuple, TypeVar
from typing import Iterable, Sequence, TypeVar
_T = TypeVar("_T")
_K = TypeVar("_K")
_V = TypeVar("_V")
__all__: List[str]
__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
@@ -17,17 +17,17 @@ def _find_build_tool(toolname: str) -> str: ... # undocumented
_SYSTEM_VERSION: str | None # undocumented
def _get_system_version() -> str: ... # undocumented
def _remove_original_values(_config_vars: Dict[str, str]) -> None: ... # undocumented
def _save_modified_value(_config_vars: Dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented
def _remove_original_values(_config_vars: dict[str, str]) -> None: ... # undocumented
def _save_modified_value(_config_vars: dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented
def _supports_universal_builds() -> bool: ... # undocumented
def _find_appropriate_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _remove_universal_flags(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _remove_unsupported_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _override_all_archs(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def _check_for_unavailable_sdk(_config_vars: Dict[str, str]) -> Dict[str, str]: ... # undocumented
def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> List[str]: ...
def customize_config_vars(_config_vars: Dict[str, str]) -> Dict[str, str]: ...
def customize_compiler(_config_vars: Dict[str, str]) -> Dict[str, str]: ...
def _find_appropriate_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _remove_universal_flags(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _remove_unsupported_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _override_all_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def _check_for_unavailable_sdk(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented
def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> list[str]: ...
def customize_config_vars(_config_vars: dict[str, str]) -> dict[str, str]: ...
def customize_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ...
def get_platform_osx(
_config_vars: Dict[str, str], osname: _T, release: _K, machine: _V
) -> Tuple[str | _T, str | _K, str | _V]: ...
_config_vars: dict[str, str], osname: _T, release: _K, machine: _V
) -> tuple[str | _T, str | _K, str | _V]: ...
+1 -3
View File
@@ -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: ...
+10 -10
View File
@@ -1,4 +1,4 @@
from typing import IO, Any, Tuple, overload
from typing import IO, Any, overload
AF_APPLETALK: int
AF_ASH: int
@@ -252,29 +252,29 @@ class SocketType(object):
proto: int
timeout: float
def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ...
def accept(self) -> Tuple[SocketType, Tuple[Any, ...]]: ...
def bind(self, address: Tuple[Any, ...]) -> None: ...
def accept(self) -> tuple[SocketType, tuple[Any, ...]]: ...
def bind(self, address: tuple[Any, ...]) -> None: ...
def close(self) -> None: ...
def connect(self, address: Tuple[Any, ...]) -> None: ...
def connect_ex(self, address: Tuple[Any, ...]) -> int: ...
def connect(self, address: tuple[Any, ...]) -> None: ...
def connect_ex(self, address: tuple[Any, ...]) -> int: ...
def dup(self) -> SocketType: ...
def fileno(self) -> int: ...
def getpeername(self) -> Tuple[Any, ...]: ...
def getsockname(self) -> Tuple[Any, ...]: ...
def getpeername(self) -> tuple[Any, ...]: ...
def getsockname(self) -> tuple[Any, ...]: ...
def getsockopt(self, level: int, option: int, buffersize: int = ...) -> str: ...
def gettimeout(self) -> float: ...
def listen(self, backlog: int) -> None: ...
def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ...
def recv(self, buffersize: int, flags: int = ...) -> str: ...
def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ...
def recvfrom(self, buffersize: int, flags: int = ...) -> Tuple[Any, ...]: ...
def recvfrom(self, buffersize: int, flags: int = ...) -> tuple[Any, ...]: ...
def recvfrom_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ...
def send(self, data: str, flags: int = ...) -> int: ...
def sendall(self, data: str, flags: int = ...) -> None: ...
@overload
def sendto(self, data: str, address: Tuple[Any, ...]) -> int: ...
def sendto(self, data: str, address: tuple[Any, ...]) -> int: ...
@overload
def sendto(self, data: str, flags: int, address: Tuple[Any, ...]) -> int: ...
def sendto(self, data: str, flags: int, address: tuple[Any, ...]) -> int: ...
def setblocking(self, flag: bool) -> None: ...
def setsockopt(self, level: int, option: int, value: int | str) -> None: ...
def settimeout(self, value: float | None) -> None: ...
+11 -11
View File
@@ -1,4 +1,4 @@
from typing import Any, Dict, Iterable, List, Mapping, Sequence, Tuple, overload
from typing import Any, Iterable, Mapping, Sequence, overload
CODESIZE: int
MAGIC: int
@@ -13,11 +13,11 @@ class SRE_Match(object):
def group(self) -> str: ...
@overload
def group(self, group: int = ...) -> str | None: ...
def groupdict(self) -> Dict[int, str | None]: ...
def groups(self) -> Tuple[str | None, ...]: ...
def span(self) -> Tuple[int, int]: ...
def groupdict(self) -> dict[int, str | None]: ...
def groups(self) -> tuple[str | None, ...]: ...
def span(self) -> tuple[int, int]: ...
@property
def regs(self) -> Tuple[Tuple[int, int], ...]: ... # undocumented
def regs(self) -> tuple[tuple[int, int], ...]: ... # undocumented
class SRE_Scanner(object):
pattern: str
@@ -30,19 +30,19 @@ class SRE_Pattern(object):
groups: int
groupindex: Mapping[str, int]
indexgroup: Sequence[int]
def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Tuple[Any, ...] | str]: ...
def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Tuple[Any, ...] | str]: ...
def findall(self, source: str, pos: int = ..., endpos: int = ...) -> list[tuple[Any, ...] | str]: ...
def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[tuple[Any, ...] | str]: ...
def match(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ...
def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ...
def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ...
def split(self, source: str, maxsplit: int = ...) -> List[str | None]: ...
def sub(self, repl: str, string: str, count: int = ...) -> Tuple[Any, ...]: ...
def subn(self, repl: str, string: str, count: int = ...) -> Tuple[Any, ...]: ...
def split(self, source: str, maxsplit: int = ...) -> list[str | None]: ...
def sub(self, repl: str, string: str, count: int = ...) -> tuple[Any, ...]: ...
def subn(self, repl: str, string: str, count: int = ...) -> tuple[Any, ...]: ...
def compile(
pattern: str,
flags: int,
code: List[int],
code: list[int],
groups: int = ...,
groupindex: Mapping[str, int] = ...,
indexgroup: Sequence[int] = ...,
+5 -5
View File
@@ -1,4 +1,4 @@
from typing import Any, AnyStr, Tuple
from typing import Any, AnyStr
class error(Exception): ...
@@ -8,12 +8,12 @@ class Struct(object):
def __init__(self, fmt: str) -> None: ...
def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ...
def pack(self, *args) -> str: ...
def unpack(self, s: str) -> Tuple[Any, ...]: ...
def unpack_from(self, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ...
def unpack(self, s: str) -> tuple[Any, ...]: ...
def unpack_from(self, buffer: bytearray, offset: int = ...) -> tuple[Any, ...]: ...
def _clearcache() -> None: ...
def calcsize(fmt: str) -> int: ...
def pack(fmt: AnyStr, obj: Any) -> str: ...
def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ...
def unpack(fmt: AnyStr, data: str) -> Tuple[Any, ...]: ...
def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any, ...]: ...
def unpack(fmt: AnyStr, data: str) -> tuple[Any, ...]: ...
def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> tuple[Any, ...]: ...
+3 -5
View File
@@ -1,5 +1,3 @@
from typing import Dict, List
CELL: int
DEF_BOUND: int
DEF_FREE: int
@@ -25,13 +23,13 @@ USE: int
class _symtable_entry(object): ...
class symtable(object):
children: List[_symtable_entry]
children: list[_symtable_entry]
id: int
lineno: int
name: str
nested: int
optimized: int
symbols: Dict[str, int]
symbols: dict[str, int]
type: int
varnames: List[str]
varnames: list[str]
def __init__(self, src: str, filename: str, startstr: str) -> None: ...
+3 -3
View File
@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Any, Callable, Dict, NoReturn, Tuple, Type
from typing import Any, Callable, NoReturn
error = RuntimeError
@@ -13,10 +13,10 @@ class LockType:
def locked(self) -> bool: ...
def __enter__(self) -> bool: ...
def __exit__(
self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
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: ...
+2 -2
View File
@@ -14,7 +14,7 @@
import array
import mmap
from typing import Any, Container, Iterable, Protocol, Text, Tuple, TypeVar, Union
from typing import Any, Container, Iterable, Protocol, Text, TypeVar, Union
from typing_extensions import Literal, final
_KT = TypeVar("_KT")
@@ -48,7 +48,7 @@ class SupportsRDivMod(Protocol[_T_contra, _T_co]):
class SupportsItems(Protocol[_KT_co, _VT_co]):
# We want dictionaries to support this on Python 2.
def items(self) -> Iterable[Tuple[_KT_co, _VT_co]]: ...
def items(self) -> Iterable[tuple[_KT_co, _VT_co]]: ...
class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]):
def keys(self) -> Iterable[_KT]: ...
+5 -5
View File
@@ -4,28 +4,28 @@
# file. They are provided for type checking purposes.
from sys import _OptExcInfo
from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Text, Tuple
from typing import Any, Callable, Iterable, Optional, Protocol, Text
class StartResponse(Protocol):
def __call__(
self, status: str, headers: List[Tuple[str, str]], exc_info: _OptExcInfo | None = ...
self, status: str, headers: list[tuple[str, str]], exc_info: _OptExcInfo | None = ...
) -> Callable[[bytes], Any]: ...
WSGIEnvironment = Dict[Text, Any]
WSGIEnvironment = dict[Text, Any]
WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]]
# WSGI input streams per PEP 3333
class InputStream(Protocol):
def read(self, size: int = ...) -> bytes: ...
def readline(self, size: int = ...) -> bytes: ...
def readlines(self, hint: int = ...) -> List[bytes]: ...
def readlines(self, hint: int = ...) -> list[bytes]: ...
def __iter__(self) -> Iterable[bytes]: ...
# WSGI error streams per PEP 3333
class ErrorStream(Protocol):
def flush(self) -> None: ...
def write(self, s: str) -> None: ...
def writelines(self, seq: List[str]) -> None: ...
def writelines(self, seq: list[str]) -> None: ...
class _Readable(Protocol):
def read(self, size: int = ...) -> bytes: ...
+9 -9
View File
@@ -1,23 +1,23 @@
from typing import Any, Dict, List, Tuple, Type, overload
from typing import Any, overload
default_action: str
once_registry: Dict[Any, Any]
once_registry: dict[Any, Any]
filters: List[Tuple[Any, ...]]
filters: list[tuple[Any, ...]]
@overload
def warn(message: str, category: Type[Warning] | None = ..., stacklevel: int = ...) -> None: ...
def warn(message: str, category: type[Warning] | None = ..., stacklevel: int = ...) -> None: ...
@overload
def warn(message: Warning, category: Any = ..., stacklevel: int = ...) -> None: ...
@overload
def warn_explicit(
message: str,
category: Type[Warning],
category: type[Warning],
filename: str,
lineno: int,
module: str | None = ...,
registry: Dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: Dict[str, Any] | None = ...,
registry: dict[str | tuple[str, type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
) -> None: ...
@overload
def warn_explicit(
@@ -26,6 +26,6 @@ def warn_explicit(
filename: str,
lineno: int,
module: str | None = ...,
registry: Dict[str | Tuple[str, Type[Warning], int], int] | None = ...,
module_globals: Dict[str, Any] | None = ...,
registry: dict[str | tuple[str, type[Warning], int], int] | None = ...,
module_globals: dict[str, Any] | None = ...,
) -> None: ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Any, Callable, Generic, List, TypeVar, overload
from typing import Any, Callable, Generic, TypeVar, overload
_C = TypeVar("_C", bound=Callable[..., Any])
_T = TypeVar("_T")
@@ -17,7 +17,7 @@ class ReferenceType(Generic[_T]):
ref = ReferenceType
def getweakrefcount(__object: Any) -> int: ...
def getweakrefs(object: Any) -> List[Any]: ...
def getweakrefs(object: Any) -> list[Any]: ...
@overload
def proxy(object: _C, callback: Callable[[_C], Any] | None = ...) -> CallableProxyType[_C]: ...
+5 -5
View File
@@ -1,6 +1,6 @@
import sys
from types import TracebackType
from typing import Any, Tuple, Type, Union
from typing import Any, Union
if sys.platform == "win32":
_KeyType = Union[HKEYType, int]
@@ -12,15 +12,15 @@ if sys.platform == "win32":
def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = ..., reserved: int = ...) -> None: ...
def DeleteValue(__key: _KeyType, __value: str) -> None: ...
def EnumKey(__key: _KeyType, __index: int) -> str: ...
def EnumValue(__key: _KeyType, __index: int) -> Tuple[str, Any, int]: ...
def EnumValue(__key: _KeyType, __index: int) -> tuple[str, Any, int]: ...
def ExpandEnvironmentStrings(__str: str) -> str: ...
def FlushKey(__key: _KeyType) -> None: ...
def LoadKey(__key: _KeyType, __sub_key: str, __file_name: str) -> None: ...
def OpenKey(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = ..., access: int = ...) -> HKEYType: ...
def QueryInfoKey(__key: _KeyType) -> Tuple[int, int, int]: ...
def QueryInfoKey(__key: _KeyType) -> tuple[int, int, int]: ...
def QueryValue(__key: _KeyType, __sub_key: str | None) -> str: ...
def QueryValueEx(__key: _KeyType, __name: str) -> Tuple[Any, int]: ...
def QueryValueEx(__key: _KeyType, __name: str) -> tuple[Any, int]: ...
def SaveKey(__key: _KeyType, __file_name: str) -> None: ...
def SetValue(__key: _KeyType, __sub_key: str, __type: int, __value: str) -> None: ...
def SetValueEx(
@@ -90,7 +90,7 @@ if sys.platform == "win32":
def __int__(self) -> int: ...
def __enter__(self) -> HKEYType: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
def Close(self) -> None: ...
def Detach(self) -> int: ...
+3 -3
View File
@@ -1,6 +1,6 @@
import _weakrefset
from _typeshed import SupportsWrite
from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar
from typing import Any, Callable, TypeVar
_FuncT = TypeVar("_FuncT", bound=Callable[..., Any])
@@ -15,11 +15,11 @@ class ABCMeta(type):
_abc_negative_cache: _weakrefset.WeakSet[Any]
_abc_negative_cache_version: int
_abc_registry: _weakrefset.WeakSet[Any]
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[Any] | None = ...) -> None: ...
def register(cls: ABCMeta, subclass: Type[Any]) -> None: ...
def register(cls: ABCMeta, subclass: type[Any]) -> None: ...
# TODO: The real abc.abstractproperty inherits from "property".
class abstractproperty(object):
+5 -5
View File
@@ -1,4 +1,4 @@
from typing import IO, Any, List, NamedTuple, Text, Tuple, Union, overload
from typing import IO, Any, NamedTuple, Text, Union, overload
from typing_extensions import Literal
class Error(Exception): ...
@@ -12,7 +12,7 @@ class _aifc_params(NamedTuple):
compname: bytes
_File = Union[Text, IO[bytes]]
_Marker = Tuple[int, int, bytes]
_Marker = tuple[int, int, bytes]
class Aifc_read:
def __init__(self, f: _File) -> None: ...
@@ -28,7 +28,7 @@ class Aifc_read:
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def getparams(self) -> _aifc_params: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def getmark(self, id: int) -> _Marker: ...
def setpos(self, pos: int) -> None: ...
def readframes(self, nframes: int) -> bytes: ...
@@ -50,11 +50,11 @@ class Aifc_write:
def setcomptype(self, comptype: bytes, compname: bytes) -> None: ...
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def setparams(self, params: Tuple[int, int, int, int, bytes, bytes]) -> None: ...
def setparams(self, params: tuple[int, int, int, int, bytes, bytes]) -> None: ...
def getparams(self) -> _aifc_params: ...
def setmark(self, id: int, pos: int, name: bytes) -> None: ...
def getmark(self, id: int) -> _Marker: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def tell(self) -> int: ...
def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol
def writeframes(self, data: Any) -> None: ...
+46 -64
View File
@@ -1,22 +1,4 @@
from typing import (
IO,
Any,
Callable,
Dict,
Generator,
Iterable,
List,
NoReturn,
Pattern,
Protocol,
Sequence,
Text,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing import IO, Any, Callable, Generator, Iterable, NoReturn, Pattern, Protocol, Sequence, Text, TypeVar, Union, overload
_T = TypeVar("_T")
_ActionT = TypeVar("_ActionT", bound=Action)
@@ -39,8 +21,8 @@ class ArgumentError(Exception):
# undocumented
class _AttributeHolder:
def _get_kwargs(self) -> List[Tuple[str, Any]]: ...
def _get_args(self) -> List[Any]: ...
def _get_kwargs(self) -> list[tuple[str, Any]]: ...
def _get_args(self) -> list[Any]: ...
# undocumented
class _ActionsContainer:
@@ -49,14 +31,14 @@ class _ActionsContainer:
argument_default: Any
conflict_handler: _Text
_registries: Dict[_Text, Dict[Any, Any]]
_actions: List[Action]
_option_string_actions: Dict[_Text, Action]
_action_groups: List[_ArgumentGroup]
_mutually_exclusive_groups: List[_MutuallyExclusiveGroup]
_defaults: Dict[str, Any]
_registries: dict[_Text, dict[Any, Any]]
_actions: list[Action]
_option_string_actions: dict[_Text, Action]
_action_groups: list[_ArgumentGroup]
_mutually_exclusive_groups: list[_MutuallyExclusiveGroup]
_defaults: dict[str, Any]
_negative_number_matcher: Pattern[str]
_has_negative_number_optionals: List[bool]
_has_negative_number_optionals: list[bool]
def __init__(self, description: Text | None, prefix_chars: Text, argument_default: Any, conflict_handler: Text) -> None: ...
def register(self, registry_name: Text, value: Any, object: Any) -> None: ...
def _registry_get(self, registry_name: Text, value: Any, default: Any = ...) -> Any: ...
@@ -65,7 +47,7 @@ class _ActionsContainer:
def add_argument(
self,
*name_or_flags: Text,
action: Text | Type[Action] = ...,
action: Text | type[Action] = ...,
nargs: int | Text = ...,
const: Any = ...,
default: Any = ...,
@@ -73,7 +55,7 @@ class _ActionsContainer:
choices: Iterable[_T] = ...,
required: bool = ...,
help: Text | None = ...,
metavar: Text | Tuple[Text, ...] | None = ...,
metavar: Text | tuple[Text, ...] | None = ...,
dest: Text | None = ...,
version: Text = ...,
**kwargs: Any,
@@ -83,13 +65,13 @@ class _ActionsContainer:
def _add_action(self, action: _ActionT) -> _ActionT: ...
def _remove_action(self, action: Action) -> None: ...
def _add_container_actions(self, container: _ActionsContainer) -> None: ...
def _get_positional_kwargs(self, dest: Text, **kwargs: Any) -> Dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: Type[Action] | None = ...) -> Type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[Tuple[Text, Action]]], Any]: ...
def _get_positional_kwargs(self, dest: Text, **kwargs: Any) -> dict[str, Any]: ...
def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
def _pop_action_class(self, kwargs: Any, default: type[Action] | None = ...) -> type[Action]: ...
def _get_handler(self) -> Callable[[Action, Iterable[tuple[Text, Action]]], Any]: ...
def _check_conflict(self, action: Action) -> None: ...
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> NoReturn: ...
def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[Tuple[Text, Action]]) -> None: ...
def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[Text, Action]]) -> NoReturn: ...
def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[tuple[Text, Action]]) -> None: ...
class _FormatterClass(Protocol):
def __call__(self, prog: str) -> HelpFormatter: ...
@@ -138,8 +120,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
title: Text = ...,
description: Text | None = ...,
prog: Text = ...,
parser_class: Type[ArgumentParser] = ...,
action: Type[Action] = ...,
parser_class: type[ArgumentParser] = ...,
action: type[Action] = ...,
option_string: Text = ...,
dest: Text | None = ...,
help: Text | None = ...,
@@ -151,21 +133,21 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def format_help(self) -> str: ...
def parse_known_args(
self, args: Sequence[Text] | None = ..., namespace: Namespace | None = ...
) -> Tuple[Namespace, List[str]]: ...
def convert_arg_line_to_args(self, arg_line: Text) -> List[str]: ...
) -> tuple[Namespace, list[str]]: ...
def convert_arg_line_to_args(self, arg_line: Text) -> list[str]: ...
def exit(self, status: int = ..., message: Text | None = ...) -> NoReturn: ...
def error(self, message: Text) -> NoReturn: ...
# undocumented
def _get_optional_actions(self) -> List[Action]: ...
def _get_positional_actions(self) -> List[Action]: ...
def _parse_known_args(self, arg_strings: List[Text], namespace: Namespace) -> Tuple[Namespace, List[str]]: ...
def _read_args_from_files(self, arg_strings: List[Text]) -> List[Text]: ...
def _get_optional_actions(self) -> list[Action]: ...
def _get_positional_actions(self) -> list[Action]: ...
def _parse_known_args(self, arg_strings: list[Text], namespace: Namespace) -> tuple[Namespace, list[str]]: ...
def _read_args_from_files(self, arg_strings: list[Text]) -> list[Text]: ...
def _match_argument(self, action: Action, arg_strings_pattern: Text) -> int: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: Text) -> List[int]: ...
def _parse_optional(self, arg_string: Text) -> Tuple[Action | None, Text, Text | None] | None: ...
def _get_option_tuples(self, option_string: Text) -> List[Tuple[Action, Text, Text | None]]: ...
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: Text) -> list[int]: ...
def _parse_optional(self, arg_string: Text) -> tuple[Action | None, Text, Text | None] | None: ...
def _get_option_tuples(self, option_string: Text) -> list[tuple[Action, Text, Text | None]]: ...
def _get_nargs_pattern(self, action: Action) -> _Text: ...
def _get_values(self, action: Action, arg_strings: List[Text]) -> Any: ...
def _get_values(self, action: Action, arg_strings: list[Text]) -> Any: ...
def _get_value(self, action: Action, arg_string: Text) -> Any: ...
def _check_value(self, action: Action, value: Any) -> None: ...
def _get_formatter(self) -> HelpFormatter: ...
@@ -184,7 +166,7 @@ class HelpFormatter:
_current_section: Any
_whitespace_matcher: Pattern[str]
_long_break_matcher: Pattern[str]
_Section: Type[Any] # Nested class
_Section: type[Any] # Nested class
def __init__(
self, prog: Text, indent_increment: int = ..., max_help_position: int = ..., width: int | None = ...
) -> None: ...
@@ -208,11 +190,11 @@ class HelpFormatter:
def _format_text(self, text: Text) -> _Text: ...
def _format_action(self, action: Action) -> _Text: ...
def _format_action_invocation(self, action: Action) -> _Text: ...
def _metavar_formatter(self, action: Action, default_metavar: Text) -> Callable[[int], Tuple[_Text, ...]]: ...
def _metavar_formatter(self, action: Action, default_metavar: Text) -> Callable[[int], tuple[_Text, ...]]: ...
def _format_args(self, action: Action, default_metavar: Text) -> _Text: ...
def _expand_help(self, action: Action) -> _Text: ...
def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ...
def _split_lines(self, text: Text, width: int) -> List[_Text]: ...
def _split_lines(self, text: Text, width: int) -> list[_Text]: ...
def _fill_text(self, text: Text, width: int, indent: Text) -> _Text: ...
def _get_help_string(self, action: Action) -> _Text | None: ...
def _get_default_metavar_for_optional(self, action: Action) -> _Text: ...
@@ -232,7 +214,7 @@ class Action(_AttributeHolder):
choices: Iterable[Any] | None
required: bool
help: _Text | None
metavar: _Text | Tuple[_Text, ...] | None
metavar: _Text | tuple[_Text, ...] | None
def __init__(
self,
option_strings: Sequence[Text],
@@ -244,7 +226,7 @@ class Action(_AttributeHolder):
choices: Iterable[_T] | None = ...,
required: bool = ...,
help: Text | None = ...,
metavar: Text | Tuple[Text, ...] | None = ...,
metavar: Text | tuple[Text, ...] | None = ...,
) -> None: ...
def __call__(
self, parser: ArgumentParser, namespace: Namespace, values: Text | Sequence[Any] | None, option_string: Text | None = ...
@@ -266,7 +248,7 @@ class FileType:
# undocumented
class _ArgumentGroup(_ActionsContainer):
title: _Text | None
_group_actions: List[Action]
_group_actions: list[Action]
def __init__(
self, container: _ActionsContainer, title: Text | None = ..., description: Text | None = ..., **kwargs: Any
) -> None: ...
@@ -290,7 +272,7 @@ class _StoreConstAction(Action):
default: Any = ...,
required: bool = ...,
help: Text | None = ...,
metavar: Text | Tuple[Text, ...] | None = ...,
metavar: Text | tuple[Text, ...] | None = ...,
) -> None: ...
# undocumented
@@ -318,7 +300,7 @@ class _AppendConstAction(Action):
default: Any = ...,
required: bool = ...,
help: Text | None = ...,
metavar: Text | Tuple[Text, ...] | None = ...,
metavar: Text | tuple[Text, ...] | None = ...,
) -> None: ...
# undocumented
@@ -342,24 +324,24 @@ class _VersionAction(Action):
# undocumented
class _SubParsersAction(Action):
_ChoicesPseudoAction: Type[Any] # nested class
_ChoicesPseudoAction: type[Any] # nested class
_prog_prefix: _Text
_parser_class: Type[ArgumentParser]
_name_parser_map: Dict[_Text, ArgumentParser]
choices: Dict[_Text, ArgumentParser]
_choices_actions: List[Action]
_parser_class: type[ArgumentParser]
_name_parser_map: dict[_Text, ArgumentParser]
choices: dict[_Text, ArgumentParser]
_choices_actions: list[Action]
def __init__(
self,
option_strings: Sequence[Text],
prog: Text,
parser_class: Type[ArgumentParser],
parser_class: type[ArgumentParser],
dest: Text = ...,
help: Text | None = ...,
metavar: Text | Tuple[Text, ...] | None = ...,
metavar: Text | tuple[Text, ...] | None = ...,
) -> None: ...
# TODO: Type keyword args properly.
def add_parser(self, name: Text, **kwargs: Any) -> ArgumentParser: ...
def _get_subactions(self) -> List[Action]: ...
def _get_subactions(self) -> list[Action]: ...
# undocumented
class ArgumentTypeError(Exception): ...
+4 -4
View File
@@ -1,4 +1,4 @@
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, Text, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
@@ -20,12 +20,12 @@ class array(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self, typecode: str, __initializer: bytes | Iterable[_T] = ...) -> None: ...
def append(self, __v: _T) -> None: ...
def buffer_info(self) -> Tuple[int, int]: ...
def buffer_info(self) -> tuple[int, int]: ...
def byteswap(self) -> None: ...
def count(self, __v: Any) -> int: ...
def extend(self, __bb: Iterable[_T]) -> None: ...
def fromfile(self, __f: BinaryIO, __n: int) -> None: ...
def fromlist(self, __list: List[_T]) -> None: ...
def fromlist(self, __list: list[_T]) -> None: ...
def fromunicode(self, __ustr: str) -> None: ...
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
def insert(self, __i: int, __v: _T) -> None: ...
@@ -34,7 +34,7 @@ class array(MutableSequence[_T], Generic[_T]):
def remove(self, __v: Any) -> None: ...
def reverse(self) -> None: ...
def tofile(self, __f: BinaryIO) -> None: ...
def tolist(self) -> List[_T]: ...
def tolist(self) -> list[_T]: ...
def tounicode(self) -> str: ...
def write(self, f: BinaryIO) -> None: ...
def fromstring(self, __buffer: bytes) -> None: ...
+2 -2
View File
@@ -1,7 +1,7 @@
import asyncore
import socket
from abc import abstractmethod
from typing import Sequence, Tuple
from typing import Sequence
class simple_producer:
def __init__(self, data: bytes, buffer_size: int = ...) -> None: ...
@@ -34,4 +34,4 @@ class fifo:
def is_empty(self) -> bool: ...
def first(self) -> bytes: ...
def push(self, data: bytes | simple_producer) -> None: ...
def pop(self) -> Tuple[int, bytes]: ...
def pop(self) -> tuple[int, bytes]: ...
+8 -8
View File
@@ -1,10 +1,10 @@
import sys
from _typeshed import FileDescriptorLike
from socket import SocketType
from typing import Any, Dict, Optional, Tuple, overload
from typing import Any, Optional, overload
# cyclic dependence with asynchat
_maptype = Dict[int, Any]
_maptype = dict[int, Any]
socket_map: _maptype # undocumented
@@ -40,9 +40,9 @@ 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 accept(self) -> Tuple[SocketType, Any] | None: ...
def bind(self, addr: tuple[Any, ...] | str) -> None: ...
def connect(self, address: tuple[Any, ...] | str) -> None: ...
def accept(self) -> tuple[SocketType, Any] | None: ...
def send(self, data: bytes) -> int: ...
def recv(self, buffer_size: int) -> bytes: ...
def close(self) -> None: ...
@@ -73,7 +73,7 @@ class dispatcher:
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
def gettimeout(self) -> float: ...
def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ...
def ioctl(self, control: object, option: tuple[int, int, int]) -> None: ...
# TODO the return value may be BinaryIO or TextIO, depending on mode
def makefile(
self, mode: str = ..., buffering: int = ..., encoding: str = ..., errors: str = ..., newline: str = ...
@@ -83,7 +83,7 @@ class dispatcher:
def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ...
def recv_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ...
def sendall(self, data: bytes, flags: int = ...) -> None: ...
def sendto(self, data: bytes, address: Tuple[str, int] | str, flags: int = ...) -> int: ...
def sendto(self, data: bytes, address: tuple[str, int] | str, flags: int = ...) -> int: ...
def setblocking(self, flag: bool) -> None: ...
def settimeout(self, value: float | None) -> None: ...
def setsockopt(self, level: int, optname: int, value: int | bytes) -> None: ...
@@ -96,7 +96,7 @@ class dispatcher_with_send(dispatcher):
# incompatible signature:
# def send(self, data: bytes) -> Optional[int]: ...
def compact_traceback() -> Tuple[Tuple[str, str, str], type, type, str]: ...
def compact_traceback() -> tuple[tuple[str, str, str], type, type, str]: ...
def close_all(map: _maptype | None = ..., ignore_all: bool = ...) -> None: ...
if sys.platform != "win32":
+7 -9
View File
@@ -1,12 +1,10 @@
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): ...
def add(__fragment1: bytes, __fragment2: bytes, __width: int) -> bytes: ...
def adpcm2lin(__fragment: bytes, __width: int, __state: AdpcmState | None) -> Tuple[bytes, AdpcmState]: ...
def adpcm2lin(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
def alaw2lin(__fragment: bytes, __width: int) -> bytes: ...
def avg(__fragment: bytes, __width: int) -> int: ...
def avgpp(__fragment: bytes, __width: int) -> int: ...
@@ -14,16 +12,16 @@ def bias(__fragment: bytes, __width: int, __bias: int) -> bytes: ...
def byteswap(__fragment: bytes, __width: int) -> bytes: ...
def cross(__fragment: bytes, __width: int) -> int: ...
def findfactor(__fragment: bytes, __reference: bytes) -> float: ...
def findfit(__fragment: bytes, __reference: bytes) -> Tuple[int, float]: ...
def findfit(__fragment: bytes, __reference: bytes) -> tuple[int, float]: ...
def findmax(__fragment: bytes, __length: int) -> int: ...
def getsample(__fragment: bytes, __width: int, __index: int) -> int: ...
def lin2adpcm(__fragment: bytes, __width: int, __state: AdpcmState | None) -> Tuple[bytes, AdpcmState]: ...
def lin2adpcm(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
def lin2alaw(__fragment: bytes, __width: int) -> bytes: ...
def lin2lin(__fragment: bytes, __width: int, __newwidth: int) -> bytes: ...
def lin2ulaw(__fragment: bytes, __width: int) -> bytes: ...
def max(__fragment: bytes, __width: int) -> int: ...
def maxpp(__fragment: bytes, __width: int) -> int: ...
def minmax(__fragment: bytes, __width: int) -> Tuple[int, int]: ...
def minmax(__fragment: bytes, __width: int) -> tuple[int, int]: ...
def mul(__fragment: bytes, __width: int, __factor: float) -> bytes: ...
def ratecv(
__fragment: bytes,
@@ -34,7 +32,7 @@ def ratecv(
__state: RatecvState | None,
__weightA: int = ...,
__weightB: int = ...,
) -> Tuple[bytes, RatecvState]: ...
) -> tuple[bytes, RatecvState]: ...
def reverse(__fragment: bytes, __width: int) -> bytes: ...
def rms(__fragment: bytes, __width: int) -> int: ...
def tomono(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ...
+15 -15
View File
@@ -1,9 +1,9 @@
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, Dict, Iterable, List, Mapping, Set, SupportsInt, Tuple, Type, TypeVar
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, 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
@@ -11,9 +11,9 @@ class BdbQuit(Exception): ...
class Bdb:
skip: Set[str] | None
breaks: Dict[str, List[int]]
fncache: Dict[str, str]
skip: set[str] | None
breaks: dict[str, list[int]]
fncache: dict[str, str]
frame_returning: FrameType | None
botframe: FrameType | None
quitting: bool
@@ -53,21 +53,21 @@ class Bdb:
def clear_all_breaks(self) -> None: ...
def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ...
def get_break(self, filename: str, lineno: int) -> bool: ...
def get_breaks(self, filename: str, lineno: int) -> List[Breakpoint]: ...
def get_file_breaks(self, filename: str) -> List[Breakpoint]: ...
def get_all_breaks(self) -> List[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> Tuple[List[Tuple[FrameType, int]], int]: ...
def get_breaks(self, filename: str, lineno: int) -> list[Breakpoint]: ...
def get_file_breaks(self, filename: str) -> list[Breakpoint]: ...
def get_all_breaks(self) -> list[Breakpoint]: ...
def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ...
def format_stack_entry(self, frame_lineno: int, lprefix: str = ...) -> str: ...
def run(self, cmd: str | CodeType, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: Dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runctx(self, cmd: str | CodeType, globals: Dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ...
def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ...
class Breakpoint:
next: int = ...
bplist: Dict[Tuple[str, int], List[Breakpoint]] = ...
bpbynumber: List[Breakpoint | None] = ...
bplist: dict[tuple[str, int], list[Breakpoint]] = ...
bpbynumber: list[Breakpoint | None] = ...
funcname: str | None
func_first_executable_line: int | None
@@ -90,5 +90,5 @@ class Breakpoint:
def __str__(self) -> str: ...
def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ...
def effective(file: str, line: int, frame: FrameType) -> Tuple[Breakpoint, bool] | Tuple[None, None]: ...
def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ...
def set_trace() -> None: ...
+2 -2
View File
@@ -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: ...
+156 -162
View File
@@ -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: ...
+2 -2
View File
@@ -1,6 +1,6 @@
import io
from _typeshed import ReadableBuffer, Self, WriteableBuffer
from typing import IO, Any, Iterable, List, Text, Union
from typing import IO, Any, Iterable, Text, Union
from typing_extensions import SupportsIndex
_PathOrFile = Union[Text, IO[bytes]]
@@ -15,7 +15,7 @@ class BZ2File(io.BufferedIOBase, IO[bytes]):
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
def readinto(self, b: WriteableBuffer) -> int: ...
def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ...
def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...
+2 -2
View File
@@ -1,7 +1,7 @@
from typing import IO, Any, List
from typing import IO, Any
HIGHEST_PROTOCOL: int
compatible_formats: List[str]
compatible_formats: list[str]
format_version: str
class Pickler:
+4 -4
View File
@@ -1,14 +1,14 @@
from _typeshed import Self
from types import CodeType
from typing import Any, Callable, Dict, Text, Tuple, TypeVar
from typing import Any, Callable, Text, TypeVar
def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ...
def runctx(
statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: str | None = ..., sort: str | int = ...
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = ..., sort: str | int = ...
) -> 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
@@ -22,7 +22,7 @@ class Profile:
def create_stats(self) -> None: ...
def snapshot_stats(self) -> None: ...
def run(self: Self, cmd: str) -> Self: ...
def runctx(self: Self, cmd: str, globals: Dict[str, Any], locals: Dict[str, Any]) -> Self: ...
def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
def label(code: str | CodeType) -> _Label: ... # undocumented
+3 -3
View File
@@ -1,5 +1,5 @@
from abc import ABCMeta
from typing import IO, Iterable, Iterator, List, overload
from typing import IO, Iterable, Iterator, overload
# This class isn't actually abstract, but you can't instantiate it
# directly, so we might as well treat it as abstract in the stub.
@@ -12,7 +12,7 @@ class InputType(IO[str], Iterator[str], metaclass=ABCMeta):
def isatty(self) -> bool: ...
def read(self, size: int = ...) -> str: ...
def readline(self, size: int = ...) -> str: ...
def readlines(self, hint: int = ...) -> List[str]: ...
def readlines(self, hint: int = ...) -> list[str]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def tell(self) -> int: ...
def truncate(self, size: int | None = ...) -> int: ...
@@ -31,7 +31,7 @@ class OutputType(IO[str], Iterator[str], metaclass=ABCMeta):
def isatty(self) -> bool: ...
def read(self, size: int = ...) -> str: ...
def readline(self, size: int = ...) -> str: ...
def readlines(self, hint: int = ...) -> List[str]: ...
def readlines(self, hint: int = ...) -> list[str]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def tell(self) -> int: ...
def truncate(self, size: int | None = ...) -> int: ...
+12 -12
View File
@@ -1,8 +1,8 @@
import datetime
from time import struct_time
from typing import Any, Iterable, List, 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: ...
@@ -15,7 +15,7 @@ class IllegalWeekdayError(ValueError):
def isleap(year: int) -> bool: ...
def leapdays(y1: int, y2: int) -> int: ...
def weekday(year: int, month: int, day: int) -> int: ...
def monthrange(year: int, month: int) -> Tuple[int, int]: ...
def monthrange(year: int, month: int) -> tuple[int, int]: ...
class Calendar:
firstweekday: int
@@ -24,14 +24,14 @@ class Calendar:
def setfirstweekday(self, firstweekday: int) -> None: ...
def iterweekdays(self) -> Iterable[int]: ...
def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ...
def itermonthdays2(self, year: int, month: int) -> Iterable[Tuple[int, int]]: ...
def itermonthdays2(self, year: int, month: int) -> Iterable[tuple[int, int]]: ...
def itermonthdays(self, year: int, month: int) -> Iterable[int]: ...
def monthdatescalendar(self, year: int, month: int) -> List[List[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> List[List[Tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> List[List[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> List[List[Tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> List[List[int]]: ...
def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ...
def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
def yeardatescalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
def yeardays2calendar(self, year: int, width: int = ...) -> list[list[tuple[int, int]]]: ...
def yeardayscalendar(self, year: int, width: int = ...) -> list[list[int]]: ...
class TextCalendar(Calendar):
def prweek(self, theweek: int, width: int) -> None: ...
@@ -46,7 +46,7 @@ class TextCalendar(Calendar):
def pryear(self, theyear: int, w: int = ..., l: int = ..., c: int = ..., m: int = ...) -> None: ...
def firstweekday() -> int: ...
def monthcalendar(year: int, month: int) -> List[List[int]]: ...
def monthcalendar(year: int, month: int) -> list[list[int]]: ...
def prweek(theweek: int, width: int) -> None: ...
def week(theweek: int, width: int) -> str: ...
def weekheader(width: int) -> str: ...
@@ -85,7 +85,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]
+7 -7
View File
@@ -1,6 +1,6 @@
from _typeshed import SupportsGetItem, SupportsItemAccess
from builtins import type as _type
from typing import IO, Any, AnyStr, Iterable, Iterator, List, Mapping, Protocol
from builtins import list as List, type as _type # aliases to avoid name clashes with `FieldStorage` attributes
from typing import IO, Any, AnyStr, Iterable, Iterator, Mapping, Protocol
from UserDict import UserDict
def parse(
@@ -8,10 +8,10 @@ def parse(
environ: SupportsItemAccess[str, str] = ...,
keep_blank_values: bool = ...,
strict_parsing: bool = ...,
) -> dict[str, List[str]]: ...
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> List[tuple[str, str]]: ...
def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> dict[str, List[bytes]]: ...
) -> dict[str, list[str]]: ...
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> dict[str, list[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> list[tuple[str, str]]: ...
def parse_multipart(fp: IO[Any], pdict: SupportsGetItem[str, bytes]) -> dict[str, list[bytes]]: ...
class _Environ(Protocol):
def __getitem__(self, __k: str) -> str: ...
@@ -86,7 +86,7 @@ class FieldStorage(object):
# In Python 2 it always returns bytes and ignores the "binary" flag
def make_file(self, binary: Any = ...) -> IO[bytes]: ...
class FormContentDict(UserDict[str, List[str]]):
class FormContentDict(UserDict[str, list[str]]):
query_string: str
def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...
+6 -6
View File
@@ -1,16 +1,16 @@
from types import FrameType, TracebackType
from typing import IO, Any, Callable, Dict, List, Optional, Text, Tuple, Type
from typing import IO, Any, Callable, Optional, Text
_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
def strong(text: str) -> str: ... # undocumented
def grey(text: str) -> str: ... # undocumented
def lookup(name: str, frame: FrameType, locals: Dict[str, Any]) -> Tuple[str | None, Any]: ... # undocumented
def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> tuple[str | None, Any]: ... # undocumented
def scanvars(
reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]
) -> List[Tuple[str, str | None, Any]]: ... # undocumented
reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any]
) -> list[tuple[str, str | None, Any]]: ... # undocumented
def html(einfo: _ExcInfo, context: int = ...) -> str: ...
def text(einfo: _ExcInfo, context: int = ...) -> str: ...
@@ -18,7 +18,7 @@ class Hook: # undocumented
def __init__(
self, display: int = ..., logdir: Text | None = ..., context: int = ..., file: IO[str] | None = ..., format: str = ...
) -> None: ...
def __call__(self, etype: Type[BaseException] | None, evalue: BaseException | None, etb: TracebackType | None) -> None: ...
def __call__(self, etype: type[BaseException] | None, evalue: BaseException | None, etb: TracebackType | None) -> None: ...
def handle(self, info: _ExcInfo | None = ...) -> None: ...
def handler(info: _ExcInfo | None = ...) -> None: ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import SupportsComplex, SupportsFloat, Tuple, Union
from typing import SupportsComplex, SupportsFloat, Union
e: float
pi: float
@@ -18,7 +18,7 @@ def isnan(__z: _C) -> bool: ...
def log(__x: _C, __y_obj: _C = ...) -> complex: ...
def log10(__z: _C) -> complex: ...
def phase(__z: _C) -> float: ...
def polar(__z: _C) -> Tuple[float, float]: ...
def polar(__z: _C) -> tuple[float, float]: ...
def rect(__r: float, __phi: float) -> complex: ...
def sin(__z: _C) -> complex: ...
def sinh(__z: _C) -> complex: ...
+11 -11
View File
@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, List, Tuple
from typing import IO, Any, Callable
class Cmd:
prompt: str
@@ -14,7 +14,7 @@ class Cmd:
use_rawinput: bool
stdin: IO[str]
stdout: IO[str]
cmdqueue: List[str]
cmdqueue: list[str]
completekey: str
def __init__(self, completekey: str = ..., stdin: IO[str] | None = ..., stdout: IO[str] | None = ...) -> None: ...
old_completer: Callable[[str, int], str | None] | None
@@ -23,17 +23,17 @@ class Cmd:
def postcmd(self, stop: bool, line: str) -> bool: ...
def preloop(self) -> None: ...
def postloop(self) -> None: ...
def parseline(self, line: str) -> Tuple[str | None, str | None, str]: ...
def parseline(self, line: str) -> tuple[str | None, str | None, str]: ...
def onecmd(self, line: str) -> bool: ...
def emptyline(self) -> bool: ...
def default(self, line: str) -> bool: ...
def completedefault(self, *ignored: Any) -> List[str]: ...
def completenames(self, text: str, *ignored: Any) -> List[str]: ...
completion_matches: List[str] | None
def complete(self, text: str, state: int) -> List[str] | None: ...
def get_names(self) -> List[str]: ...
def completedefault(self, *ignored: Any) -> list[str]: ...
def completenames(self, text: str, *ignored: Any) -> list[str]: ...
completion_matches: list[str] | None
def complete(self, text: str, state: int) -> list[str] | None: ...
def get_names(self) -> list[str]: ...
# Only the first element of args matters.
def complete_help(self, *args: Any) -> List[str]: ...
def complete_help(self, *args: Any) -> list[str]: ...
def do_help(self, arg: str) -> bool | None: ...
def print_topics(self, header: str, cmds: List[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: List[str] | None, displaywidth: int = ...) -> None: ...
def print_topics(self, header: str, cmds: list[str] | None, cmdlen: Any, maxcol: int) -> None: ...
def columnize(self, list: list[str] | None, displaywidth: int = ...) -> None: ...
+25 -41
View File
@@ -1,23 +1,7 @@
import types
from _typeshed import Self
from abc import abstractmethod
from typing import (
IO,
Any,
BinaryIO,
Callable,
Generator,
Iterable,
Iterator,
List,
Protocol,
Text,
TextIO,
Tuple,
Type,
Union,
overload,
)
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, Text, TextIO, Union, overload
from typing_extensions import Literal
# TODO: this only satisfies the most common interface, where
@@ -30,10 +14,10 @@ _Decoded = Text
_Encoded = bytes
class _Encoder(Protocol):
def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode
def __call__(self, input: _Decoded, errors: str = ...) -> tuple[_Encoded, int]: ... # signature of Codec().encode
class _Decoder(Protocol):
def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode
def __call__(self, input: _Encoded, errors: str = ...) -> tuple[_Decoded, int]: ... # signature of Codec().decode
class _StreamReader(Protocol):
def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ...
@@ -83,10 +67,10 @@ def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: .
def lookup(__encoding: str) -> CodecInfo: ...
def utf_16_be_decode(
__data: _Encoded, __errors: str | None = ..., __final: bool = ...
) -> Tuple[_Decoded, int]: ... # undocumented
def utf_16_be_encode(__str: _Decoded, __errors: str | None = ...) -> Tuple[_Encoded, int]: ... # undocumented
) -> tuple[_Decoded, int]: ... # undocumented
def utf_16_be_encode(__str: _Decoded, __errors: str | None = ...) -> tuple[_Encoded, int]: ... # undocumented
class CodecInfo(Tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]):
@property
def encode(self) -> _Encoder: ...
@property
@@ -141,19 +125,19 @@ BOM_UTF32_LE: bytes
# It is expected that different actions be taken depending on which of the
# three subclasses of `UnicodeError` is actually ...ed. However, the Union
# is still needed for at least one of the cases.
def register_error(__errors: str, __handler: Callable[[UnicodeError], Tuple[str | bytes, int]]) -> None: ...
def lookup_error(__name: str) -> Callable[[UnicodeError], Tuple[str | bytes, int]]: ...
def strict_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def replace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def ignore_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def xmlcharrefreplace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def backslashreplace_errors(exception: UnicodeError) -> Tuple[str | bytes, int]: ...
def register_error(__errors: str, __handler: Callable[[UnicodeError], tuple[str | bytes, int]]) -> None: ...
def lookup_error(__name: str) -> Callable[[UnicodeError], tuple[str | bytes, int]]: ...
def strict_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def replace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def ignore_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def xmlcharrefreplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
def backslashreplace_errors(exception: UnicodeError) -> tuple[str | bytes, int]: ...
class Codec:
# These are sort of @abstractmethod but sort of not.
# The StreamReader and StreamWriter subclasses only implement one.
def encode(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ...
def decode(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ...
def encode(self, input: _Decoded, errors: str = ...) -> tuple[_Encoded, int]: ...
def decode(self, input: _Encoded, errors: str = ...) -> tuple[_Decoded, int]: ...
class IncrementalEncoder:
errors: str
@@ -171,8 +155,8 @@ class IncrementalDecoder:
@abstractmethod
def decode(self, input: _Encoded, final: bool = ...) -> _Decoded: ...
def reset(self) -> None: ...
def getstate(self) -> Tuple[_Encoded, int]: ...
def setstate(self, state: Tuple[_Encoded, int]) -> None: ...
def getstate(self) -> tuple[_Encoded, int]: ...
def setstate(self, state: tuple[_Encoded, int]) -> None: ...
# These are not documented but used in encodings/*.py implementations.
class BufferedIncrementalEncoder(IncrementalEncoder):
@@ -186,7 +170,7 @@ class BufferedIncrementalDecoder(IncrementalDecoder):
buffer: bytes
def __init__(self, errors: str = ...) -> None: ...
@abstractmethod
def _buffer_decode(self, input: _Encoded, errors: str, final: bool) -> Tuple[_Decoded, int]: ...
def _buffer_decode(self, input: _Encoded, errors: str, final: bool) -> tuple[_Decoded, int]: ...
def decode(self, input: _Encoded, final: bool = ...) -> _Decoded: ...
# TODO: it is not possible to specify the requirement that all other
@@ -198,7 +182,7 @@ class StreamWriter(Codec):
def writelines(self, list: Iterable[_Decoded]) -> None: ...
def reset(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: Type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ...
class StreamReader(Codec):
@@ -206,10 +190,10 @@ class StreamReader(Codec):
def __init__(self, stream: IO[_Encoded], errors: str = ...) -> None: ...
def read(self, size: int = ..., chars: int = ..., firstline: bool = ...) -> _Decoded: ...
def readline(self, size: int | None = ..., keepends: bool = ...) -> _Decoded: ...
def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> List[_Decoded]: ...
def readlines(self, sizehint: int | None = ..., keepends: bool = ...) -> list[_Decoded]: ...
def reset(self) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: Type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __iter__(self) -> Iterator[_Decoded]: ...
def __getattr__(self, name: str, getattr: Callable[[str], Any] = ...) -> Any: ...
@@ -219,7 +203,7 @@ class StreamReaderWriter(TextIO):
def __init__(self, stream: IO[_Encoded], Reader: _StreamReader, Writer: _StreamWriter, errors: str = ...) -> None: ...
def read(self, size: int = ...) -> _Decoded: ...
def readline(self, size: int | None = ...) -> _Decoded: ...
def readlines(self, sizehint: int | None = ...) -> List[_Decoded]: ...
def readlines(self, sizehint: int | None = ...) -> list[_Decoded]: ...
def next(self) -> Text: ...
def __iter__(self: Self) -> Self: ...
# This actually returns None, but that's incompatible with the supertype
@@ -229,7 +213,7 @@ class StreamReaderWriter(TextIO):
# Same as write()
def seek(self, offset: int, whence: int = ...) -> int: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, typ: Type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __getattr__(self, name: str) -> Any: ...
# These methods don't actually exist directly, but they are needed to satisfy the TextIO
# interface. At runtime, they are delegated through __getattr__.
@@ -255,7 +239,7 @@ class StreamRecoder(BinaryIO):
) -> None: ...
def read(self, size: int = ...) -> bytes: ...
def readline(self, size: int | None = ...) -> bytes: ...
def readlines(self, sizehint: int | None = ...) -> List[bytes]: ...
def readlines(self, sizehint: int | None = ...) -> list[bytes]: ...
def next(self) -> bytes: ...
def __iter__(self: Self) -> Self: ...
def write(self, data: bytes) -> int: ...
@@ -263,7 +247,7 @@ class StreamRecoder(BinaryIO):
def reset(self) -> None: ...
def __getattr__(self, name: str) -> Any: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, type: Type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ...
# These methods don't actually exist directly, but they are needed to satisfy the BinaryIO
# interface. At runtime, they are delegated through __getattr__.
def seek(self, offset: int, whence: int = ...) -> int: ...
+9 -13
View File
@@ -4,14 +4,12 @@ from typing import (
Any,
Callable as Callable,
Container as Container,
Dict,
Generic,
Hashable as Hashable,
ItemsView as ItemsView,
Iterable as Iterable,
Iterator as Iterator,
KeysView as KeysView,
List,
Mapping as Mapping,
MappingView as MappingView,
MutableMapping as MutableMapping,
@@ -20,8 +18,6 @@ from typing import (
Reversible,
Sequence as Sequence,
Sized as Sized,
Tuple,
Type,
TypeVar,
ValuesView as ValuesView,
overload,
@@ -36,7 +32,7 @@ _VT = TypeVar("_VT")
# namedtuple is special-cased in the type checker; the initializer is ignored.
def namedtuple(
typename: str | unicode, field_names: str | unicode | Iterable[str | unicode], verbose: bool = ..., rename: bool = ...
) -> Type[Tuple[Any, ...]]: ...
) -> type[tuple[Any, ...]]: ...
class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
def __init__(self, iterable: Iterable[_T] = ..., maxlen: int = ...) -> None: ...
@@ -63,7 +59,7 @@ class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
def __reversed__(self) -> Iterator[_T]: ...
def __iadd__(self: Self, iterable: Iterable[_T]) -> Self: ...
class Counter(Dict[_T, int], Generic[_T]):
class Counter(dict[_T, int], Generic[_T]):
@overload
def __init__(self, **kwargs: int) -> None: ...
@overload
@@ -72,7 +68,7 @@ class Counter(Dict[_T, int], Generic[_T]):
def __init__(self, iterable: Iterable[_T]) -> None: ...
def copy(self: Self) -> Self: ...
def elements(self) -> Iterator[_T]: ...
def most_common(self, n: int | None = ...) -> List[Tuple[_T, int]]: ...
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
@overload
def subtract(self, __mapping: Mapping[_T, int]) -> None: ...
@overload
@@ -85,7 +81,7 @@ class Counter(Dict[_T, int], Generic[_T]):
@overload
def update(self, __m: Mapping[_T, int], **kwargs: int) -> None: ...
@overload
def update(self, __m: Iterable[_T] | Iterable[Tuple[_T, int]], **kwargs: int) -> None: ...
def update(self, __m: Iterable[_T] | Iterable[tuple[_T, int]], **kwargs: int) -> None: ...
@overload
def update(self, **kwargs: int) -> None: ...
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
@@ -97,12 +93,12 @@ class Counter(Dict[_T, int], Generic[_T]):
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
def popitem(self, last: bool = ...) -> tuple[_KT, _VT]: ...
def copy(self: Self) -> Self: ...
def __reversed__(self) -> Iterator[_KT]: ...
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
default_factory: Callable[[], _VT]
@overload
def __init__(self, **kwargs: _VT) -> None: ...
@@ -115,8 +111,8 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
@overload
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
def __missing__(self, key: _KT) -> _VT: ...
def copy(self: Self) -> Self: ...
+6 -8
View File
@@ -1,11 +1,9 @@
from typing import Tuple
def rgb_to_yiq(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def yiq_to_rgb(y: float, i: float, q: float) -> Tuple[float, float, float]: ...
def rgb_to_hls(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def hls_to_rgb(h: float, l: float, s: float) -> Tuple[float, float, float]: ...
def rgb_to_hsv(r: float, g: float, b: float) -> Tuple[float, float, float]: ...
def hsv_to_rgb(h: float, s: float, v: float) -> Tuple[float, float, float]: ...
def rgb_to_yiq(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def yiq_to_rgb(y: float, i: float, q: float) -> tuple[float, float, float]: ...
def rgb_to_hls(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def hls_to_rgb(h: float, l: float, s: float) -> tuple[float, float, float]: ...
def rgb_to_hsv(r: float, g: float, b: float) -> tuple[float, float, float]: ...
def hsv_to_rgb(h: float, s: float, v: float) -> tuple[float, float, float]: ...
# TODO undocumented
ONE_SIXTH: float
+2 -2
View File
@@ -1,8 +1,8 @@
from typing import AnyStr, Text, Tuple, overload
from typing import AnyStr, Text, overload
def getstatus(file: Text) -> str: ...
def getoutput(cmd: Text) -> str: ...
def getstatusoutput(cmd: Text) -> Tuple[int, str]: ...
def getstatusoutput(cmd: Text) -> tuple[int, str]: ...
@overload
def mk2arg(head: bytes, x: bytes) -> bytes: ...
@overload
+2 -2
View File
@@ -1,11 +1,11 @@
from types import TracebackType
from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Protocol, Type, TypeVar
from typing import IO, Any, Callable, ContextManager, Iterable, Iterator, Optional, Protocol, TypeVar
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_F = TypeVar("_F", bound=Callable[..., Any])
_ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool]
_ExitFunc = Callable[[Optional[type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool]
class GeneratorContextManager(ContextManager[_T_co]):
def __call__(self, func: _F) -> _F: ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Any, Dict, TypeVar
from typing import Any, TypeVar
_T = TypeVar("_T")
@@ -6,7 +6,7 @@ _T = TypeVar("_T")
PyStringMap: Any
# Note: memo and _nil are internal kwargs.
def deepcopy(x: _T, memo: Dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ...
def deepcopy(x: _T, memo: dict[int, Any] | None = ..., _nil: Any = ...) -> _T: ...
def copy(x: _T) -> _T: ...
class Error(Exception): ...
+3 -3
View File
@@ -1,9 +1,9 @@
from typing import Any, Callable, Hashable, List, 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]
__all__: list[str]
def pickle(
ob_type: _TypeT,
+3 -3
View File
@@ -1,9 +1,9 @@
from typing import Any, Callable, Hashable, List, 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]
__all__: list[str]
def pickle(
ob_type: _TypeT,
+4 -16
View File
@@ -16,20 +16,8 @@ from _csv import (
unregister_dialect as unregister_dialect,
writer as writer,
)
from typing import (
Any,
Dict as _DictReadMapping,
Generic,
Iterable,
Iterator,
List,
Mapping,
Sequence,
Text,
Type,
TypeVar,
overload,
)
from builtins import dict as _DictReadMapping
from typing import Any, Generic, Iterable, Iterator, Mapping, Sequence, Text, TypeVar, overload
_T = TypeVar("_T")
@@ -96,7 +84,7 @@ class DictWriter(Generic[_T]):
def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ...
class Sniffer(object):
preferred: List[str]
preferred: list[str]
def __init__(self) -> None: ...
def sniff(self, sample: str, delimiters: str | None = ...) -> Type[Dialect]: ...
def sniff(self, sample: str, delimiters: str | None = ...) -> type[Dialect]: ...
def has_header(self, sample: str) -> bool: ...
+30 -33
View File
@@ -7,13 +7,10 @@ from typing import (
Generic,
Iterable,
Iterator,
List,
Mapping,
Optional,
Sequence,
Text,
Tuple,
Type,
TypeVar,
Union as _UnionT,
overload,
@@ -32,7 +29,7 @@ class CDLL(object):
_func_restype_: ClassVar[_CData] = ...
_name: str = ...
_handle: int = ...
_FuncPtr: Type[_FuncPointer] = ...
_FuncPtr: type[_FuncPointer] = ...
def __init__(
self, name: str | None, mode: int = ..., handle: int | None = ..., use_errno: bool = ..., use_last_error: bool = ...
) -> None: ...
@@ -46,7 +43,7 @@ if sys.platform == "win32":
class PyDLL(CDLL): ...
class LibraryLoader(Generic[_DLLT]):
def __init__(self, dlltype: Type[_DLLT]) -> None: ...
def __init__(self, dlltype: type[_DLLT]) -> None: ...
def __getattr__(self, name: str) -> _DLLT: ...
def __getitem__(self, name: str) -> _DLLT: ...
def LoadLibrary(self, name: str) -> _DLLT: ...
@@ -69,42 +66,42 @@ class _CDataMeta(type):
# By default mypy complains about the following two methods, because strictly speaking cls
# might not be a Type[_CT]. However this can never actually happen, because the only class that
# uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here.
def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore
def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore
class _CData(metaclass=_CDataMeta):
_b_base: int = ...
_b_needsfree_: bool = ...
_objects: Mapping[Any, int] | None = ...
@classmethod
def from_buffer(cls: Type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ...
def from_buffer(cls: type[_CT], source: _WritableBuffer, offset: int = ...) -> _CT: ...
@classmethod
def from_buffer_copy(cls: Type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ...
def from_buffer_copy(cls: type[_CT], source: _ReadOnlyBuffer, offset: int = ...) -> _CT: ...
@classmethod
def from_address(cls: Type[_CT], address: int) -> _CT: ...
def from_address(cls: type[_CT], address: int) -> _CT: ...
@classmethod
def from_param(cls: Type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ...
def from_param(cls: type[_CT], obj: Any) -> _UnionT[_CT, _CArgObject]: ...
@classmethod
def in_dll(cls: Type[_CT], library: CDLL, name: str) -> _CT: ...
def in_dll(cls: type[_CT], library: CDLL, name: str) -> _CT: ...
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: _UnionT[Type[_CData], Callable[[int], Any], None] = ...
argtypes: Sequence[Type[_CData]] = ...
restype: _UnionT[type[_CData], Callable[[int], Any], None] = ...
argtypes: Sequence[type[_CData]] = ...
errcheck: _ECT = ...
@overload
def __init__(self, address: int) -> None: ...
@overload
def __init__(self, callable: Callable[..., Any]) -> None: ...
@overload
def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ...
def __init__(self, func_spec: tuple[_UnionT[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):
@@ -113,15 +110,15 @@ class _NamedFuncPointer(_FuncPointer):
class ArgumentError(Exception): ...
def CFUNCTYPE(
restype: Type[_CData] | None, *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> Type[_FuncPointer]: ...
restype: type[_CData] | None, *argtypes: type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> type[_FuncPointer]: ...
if sys.platform == "win32":
def WINFUNCTYPE(
restype: Type[_CData] | None, *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> Type[_FuncPointer]: ...
restype: type[_CData] | None, *argtypes: type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> type[_FuncPointer]: ...
def PYFUNCTYPE(restype: Type[_CData] | None, *argtypes: Type[_CData]) -> Type[_FuncPointer]: ...
def PYFUNCTYPE(restype: type[_CData] | None, *argtypes: type[_CData]) -> type[_FuncPointer]: ...
class _CArgObject: ...
@@ -135,12 +132,12 @@ _CVoidPLike = _UnionT[_PointerLike, Array[Any], _CArgObject, int]
_CVoidConstPLike = _UnionT[_CVoidPLike, bytes]
def addressof(obj: _CData) -> int: ...
def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ...
def alignment(obj_or_type: _UnionT[_CData, type[_CData]]) -> int: ...
def byref(obj: _CData, offset: int = ...) -> _CArgObject: ...
_CastT = TypeVar("_CastT", bound=_CanCastTo)
def cast(obj: _UnionT[_CData, _CArgObject, int], typ: Type[_CastT]) -> _CastT: ...
def cast(obj: _UnionT[_CData, _CArgObject, int], typ: type[_CastT]) -> _CastT: ...
def create_string_buffer(init: _UnionT[int, bytes], size: int | None = ...) -> Array[c_char]: ...
c_buffer = create_string_buffer
@@ -160,32 +157,32 @@ if sys.platform == "win32":
def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ...
def memset(dst: _CVoidPLike, c: int, count: int) -> None: ...
def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ...
def POINTER(type: type[_CT]) -> type[pointer[_CT]]: ...
# The real ctypes.pointer is a function, not a class. The stub version of pointer behaves like
# ctypes._Pointer in that it is the base class for all pointer types. Unlike the real _Pointer,
# it can be instantiated directly (to mimic the behavior of the real pointer function).
class pointer(Generic[_CT], _PointerLike, _CData):
_type_: Type[_CT] = ...
_type_: type[_CT] = ...
contents: _CT = ...
def __init__(self, arg: _CT = ...) -> None: ...
@overload
def __getitem__(self, i: int) -> _CT: ...
@overload
def __getitem__(self, s: slice) -> List[_CT]: ...
def __getitem__(self, s: slice) -> list[_CT]: ...
@overload
def __setitem__(self, i: int, o: _CT) -> None: ...
@overload
def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ...
def resize(obj: _CData, size: int) -> None: ...
def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ...
def set_conversion_mode(encoding: str, errors: str) -> tuple[str, str]: ...
def set_errno(value: int) -> int: ...
if sys.platform == "win32":
def set_last_error(value: int) -> int: ...
def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ...
def sizeof(obj_or_type: _UnionT[_CData, type[_CData]]) -> int: ...
def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ...
if sys.platform == "win32":
@@ -246,7 +243,7 @@ class _CField:
size: int = ...
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ...
_fields_: Sequence[_UnionT[tuple[str, type[_CData]], tuple[str, type[_CData], int]]] = ...
_pack_: int = ...
_anonymous_: Sequence[str] = ...
def __getattr__(self, name: str) -> _CField: ...
@@ -263,7 +260,7 @@ class LittleEndianStructure(Structure): ...
class Array(Generic[_CT], _CData):
_length_: int = ...
_type_: Type[_CT] = ...
_type_: type[_CT] = ...
raw: bytes = ... # Note: only available if _CT == c_char
value: Any = ... # Note: bytes if _CT == c_char, Text if _CT == c_wchar, unavailable otherwise
# TODO These methods cannot be annotated correctly at the moment.
@@ -282,7 +279,7 @@ class Array(Generic[_CT], _CData):
@overload
def __getitem__(self, i: int) -> Any: ...
@overload
def __getitem__(self, s: slice) -> List[Any]: ...
def __getitem__(self, s: slice) -> list[Any]: ...
@overload
def __setitem__(self, i: int, o: Any) -> None: ...
@overload
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import List, TypeVar
from typing import TypeVar
_CharT = TypeVar("_CharT", str, int)
@@ -39,7 +39,7 @@ US: int
SP: int
DEL: int
controlnames: List[int]
controlnames: list[int]
def isalnum(c: str | int) -> bool: ...
def isalpha(c: str | int) -> bool: ...
+16 -16
View File
@@ -1,5 +1,5 @@
from time import struct_time
from typing import AnyStr, ClassVar, SupportsAbs, Tuple, Type, TypeVar, Union, overload
from typing import AnyStr, ClassVar, SupportsAbs, TypeVar, Union, overload
_S = TypeVar("_S")
@@ -20,13 +20,13 @@ class date:
min: ClassVar[date]
max: ClassVar[date]
resolution: ClassVar[timedelta]
def __new__(cls: Type[_S], year: int, month: int, day: int) -> _S: ...
def __new__(cls: type[_S], year: int, month: int, day: int) -> _S: ...
@classmethod
def fromtimestamp(cls: Type[_S], __timestamp: float) -> _S: ...
def fromtimestamp(cls: type[_S], __timestamp: float) -> _S: ...
@classmethod
def today(cls: Type[_S]) -> _S: ...
def today(cls: type[_S]) -> _S: ...
@classmethod
def fromordinal(cls: Type[_S], n: int) -> _S: ...
def fromordinal(cls: type[_S], n: int) -> _S: ...
@property
def year(self) -> int: ...
@property
@@ -53,14 +53,14 @@ class date:
def __hash__(self) -> int: ...
def weekday(self) -> int: ...
def isoweekday(self) -> int: ...
def isocalendar(self) -> Tuple[int, int, int]: ...
def isocalendar(self) -> tuple[int, int, int]: ...
class time:
min: ClassVar[time]
max: ClassVar[time]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S], hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: _tzinfo | None = ...
cls: type[_S], hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: _tzinfo | None = ...
) -> _S: ...
@property
def hour(self) -> int: ...
@@ -95,7 +95,7 @@ class timedelta(SupportsAbs[timedelta]):
max: ClassVar[timedelta]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S],
cls: type[_S],
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
@@ -139,7 +139,7 @@ class datetime(date):
max: ClassVar[datetime]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S],
cls: type[_S],
year: int,
month: int,
day: int,
@@ -166,21 +166,21 @@ class datetime(date):
@property
def tzinfo(self) -> _tzinfo | None: ...
@classmethod
def fromtimestamp(cls: Type[_S], t: float, tz: _tzinfo | None = ...) -> _S: ...
def fromtimestamp(cls: type[_S], t: float, tz: _tzinfo | None = ...) -> _S: ...
@classmethod
def utcfromtimestamp(cls: Type[_S], t: float) -> _S: ...
def utcfromtimestamp(cls: type[_S], t: float) -> _S: ...
@classmethod
def today(cls: Type[_S]) -> _S: ...
def today(cls: type[_S]) -> _S: ...
@classmethod
def fromordinal(cls: Type[_S], n: int) -> _S: ...
def fromordinal(cls: type[_S], n: int) -> _S: ...
@overload
@classmethod
def now(cls: Type[_S], tz: None = ...) -> _S: ...
def now(cls: type[_S], tz: None = ...) -> _S: ...
@overload
@classmethod
def now(cls, tz: _tzinfo) -> datetime: ...
@classmethod
def utcnow(cls: Type[_S]) -> _S: ...
def utcnow(cls: type[_S]) -> _S: ...
@classmethod
def combine(cls, date: _date, time: _time) -> datetime: ...
def strftime(self, fmt: _Text) -> str: ...
@@ -223,4 +223,4 @@ class datetime(date):
def __hash__(self) -> int: ...
def weekday(self) -> int: ...
def isoweekday(self) -> int: ...
def isocalendar(self) -> Tuple[int, int, int]: ...
def isocalendar(self) -> tuple[int, int, int]: ...
+3 -3
View File
@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Iterator, MutableMapping, Tuple, Type, Union
from typing import Iterator, MutableMapping, Union
from typing_extensions import Literal
_KeyType = Union[str, bytes]
@@ -15,12 +15,12 @@ class _Database(MutableMapping[_KeyType, bytes]):
def __del__(self) -> None: ...
def __enter__(self) -> _Database: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
class _error(Exception): ...
error = Tuple[Type[_error], Type[OSError]]
error = tuple[type[_error], type[OSError]]
def whichdb(filename: str) -> str: ...
def open(file: str, flag: Literal["r", "w", "c", "n"] = ..., mode: int = ...) -> _Database: ...
+2 -2
View File
@@ -1,5 +1,5 @@
from types import TracebackType
from typing import Iterator, MutableMapping, Type, Union
from typing import Iterator, MutableMapping, Union
_KeyType = Union[str, bytes]
_ValueType = Union[str, bytes]
@@ -19,7 +19,7 @@ class _Database(MutableMapping[_KeyType, bytes]):
def __del__(self) -> None: ...
def __enter__(self) -> _Database: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def open(file: str, flag: str = ..., mode: int = ...) -> _Database: ...
+3 -3
View File
@@ -1,5 +1,5 @@
from types import TracebackType
from typing import List, Type, TypeVar, Union, overload
from typing import TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]
@@ -20,13 +20,13 @@ class _gdbm:
def __len__(self) -> int: ...
def __enter__(self) -> _gdbm: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
@overload
def get(self, k: _KeyType) -> bytes | None: ...
@overload
def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ...
def keys(self) -> List[bytes]: ...
def keys(self) -> list[bytes]: ...
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
# Don't exist at runtime
__new__: None # type: ignore
+3 -3
View File
@@ -1,5 +1,5 @@
from types import TracebackType
from typing import List, Type, TypeVar, Union, overload
from typing import TypeVar, Union, overload
_T = TypeVar("_T")
_KeyType = Union[str, bytes]
@@ -19,13 +19,13 @@ class _dbm:
def __del__(self) -> None: ...
def __enter__(self) -> _dbm: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
@overload
def get(self, k: _KeyType) -> bytes | None: ...
@overload
def get(self, k: _KeyType, default: bytes | _T) -> bytes | _T: ...
def keys(self) -> List[bytes]: ...
def keys(self) -> list[bytes]: ...
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
# Don't exist at runtime
__new__: None # type: ignore
+15 -15
View File
@@ -1,14 +1,14 @@
from types import TracebackType
from typing import Any, Container, Dict, List, NamedTuple, Sequence, Text, Tuple, Type, TypeVar, Union
from typing import Any, Container, NamedTuple, Sequence, Text, TypeVar, Union
_Decimal = Union[Decimal, int]
_DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]]
_DecimalNew = Union[Decimal, float, Text, tuple[int, Sequence[int], int]]
_ComparableNum = Union[Decimal, float]
_DecimalT = TypeVar("_DecimalT", bound=Decimal)
class DecimalTuple(NamedTuple):
sign: int
digits: Tuple[int, ...]
digits: tuple[int, ...]
exponent: int
ROUND_DOWN: str
@@ -41,7 +41,7 @@ def getcontext() -> Context: ...
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
class Decimal(object):
def __new__(cls: Type[_DecimalT], value: _DecimalNew = ..., context: Context | None = ...) -> _DecimalT: ...
def __new__(cls: type[_DecimalT], value: _DecimalNew = ..., context: Context | None = ...) -> _DecimalT: ...
@classmethod
def from_float(cls, __f: float) -> Decimal: ...
def __nonzero__(self) -> bool: ...
@@ -54,7 +54,7 @@ class Decimal(object):
def to_eng_string(self, context: Context | None = ...) -> str: ...
def __abs__(self, round: bool = ..., context: Context | None = ...) -> Decimal: ...
def __add__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __divmod__(self, other: _Decimal, context: Context | None = ...) -> Tuple[Decimal, Decimal]: ...
def __divmod__(self, other: _Decimal, context: Context | None = ...) -> tuple[Decimal, Decimal]: ...
def __eq__(self, other: object, context: Context | None = ...) -> bool: ...
def __floordiv__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __ge__(self, other: _ComparableNum, context: Context | None = ...) -> bool: ...
@@ -67,7 +67,7 @@ class Decimal(object):
def __pos__(self, context: Context | None = ...) -> Decimal: ...
def __pow__(self, other: _Decimal, modulo: _Decimal | None = ..., context: Context | None = ...) -> Decimal: ...
def __radd__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __rdivmod__(self, other: _Decimal, context: Context | None = ...) -> Tuple[Decimal, Decimal]: ...
def __rdivmod__(self, other: _Decimal, context: Context | None = ...) -> tuple[Decimal, Decimal]: ...
def __rfloordiv__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __rmod__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __rmul__(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
@@ -136,7 +136,7 @@ class Decimal(object):
def rotate(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def scaleb(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def shift(self, other: _Decimal, context: Context | None = ...) -> Decimal: ...
def __reduce__(self) -> Tuple[Type[Decimal], Tuple[str]]: ...
def __reduce__(self) -> tuple[type[Decimal], tuple[str]]: ...
def __copy__(self) -> Decimal: ...
def __deepcopy__(self, memo: Any) -> Decimal: ...
def __format__(self, specifier: str, context: Context | None = ...) -> str: ...
@@ -146,9 +146,9 @@ class _ContextManager(object):
saved_context: Context
def __init__(self, new_context: Context) -> None: ...
def __enter__(self) -> Context: ...
def __exit__(self, t: Type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
_TrapType = Type[DecimalException]
_TrapType = type[DecimalException]
class Context(object):
prec: int
@@ -157,19 +157,19 @@ class Context(object):
Emax: int
capitals: int
_clamp: int
traps: Dict[_TrapType, bool]
flags: Dict[_TrapType, bool]
traps: dict[_TrapType, bool]
flags: dict[_TrapType, bool]
def __init__(
self,
prec: int | None = ...,
rounding: str | None = ...,
traps: None | Dict[_TrapType, bool] | Container[_TrapType] = ...,
flags: None | Dict[_TrapType, bool] | Container[_TrapType] = ...,
traps: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
flags: None | dict[_TrapType, bool] | Container[_TrapType] = ...,
Emin: int | None = ...,
Emax: int | None = ...,
capitals: int | None = ...,
_clamp: int | None = ...,
_ignored_flags: List[_TrapType] | None = ...,
_ignored_flags: list[_TrapType] | None = ...,
) -> None: ...
def clear_flags(self) -> None: ...
def copy(self) -> Context: ...
@@ -192,7 +192,7 @@ class Context(object):
def copy_sign(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divide_int(self, __x: _Decimal, __y: _Decimal) -> Decimal: ...
def divmod(self, __x: _Decimal, __y: _Decimal) -> Tuple[Decimal, Decimal]: ...
def divmod(self, __x: _Decimal, __y: _Decimal) -> tuple[Decimal, Decimal]: ...
def exp(self, __x: _Decimal) -> Decimal: ...
def fma(self, __x: _Decimal, __y: _Decimal, __z: _Decimal) -> Decimal: ...
def is_canonical(self, __x: _Decimal) -> bool: ...
+6 -21
View File
@@ -1,19 +1,4 @@
from typing import (
Any,
AnyStr,
Callable,
Generic,
Iterable,
Iterator,
List,
NamedTuple,
Sequence,
Text,
Tuple,
TypeVar,
Union,
overload,
)
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, Text, TypeVar, Union, overload
_T = TypeVar("_T")
@@ -35,9 +20,9 @@ class SequenceMatcher(Generic[_T]):
def set_seq1(self, a: Sequence[_T]) -> None: ...
def set_seq2(self, b: Sequence[_T]) -> None: ...
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
def get_matching_blocks(self) -> List[Match]: ...
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
def get_matching_blocks(self) -> list[Match]: ...
def get_opcodes(self) -> list[tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[list[tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
@@ -46,11 +31,11 @@ class SequenceMatcher(Generic[_T]):
@overload
def get_close_matches( # type: ignore
word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...
) -> List[AnyStr]: ...
) -> list[AnyStr]: ...
@overload
def get_close_matches(
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ...
) -> List[Sequence[_T]]: ...
) -> list[Sequence[_T]]: ...
class Differ:
def __init__(self, linejunk: _JunkCallback | None = ..., charjunk: _JunkCallback | None = ...) -> None: ...
+2 -2
View File
@@ -1,7 +1,7 @@
from typing import List, MutableSequence, Text
from typing import MutableSequence, Text
def reset() -> None: ...
def listdir(path: Text) -> List[str]: ...
def listdir(path: Text) -> list[str]: ...
opendir = listdir
+4 -4
View File
@@ -13,17 +13,17 @@ from opcode import (
opmap as opmap,
opname as opname,
)
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
from typing import Any, Callable, Iterator, Union
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
# for functions (python/mypy#3171)
_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
_have_code_or_string = Union[_have_code, str, bytes]
COMPILER_FLAG_NAMES: Dict[int, str]
COMPILER_FLAG_NAMES: dict[int, str]
def findlabels(code: _have_code) -> List[int]: ...
def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
def findlabels(code: _have_code) -> list[int]: ...
def findlinestarts(code: _have_code) -> Iterator[tuple[int, int]]: ...
def dis(x: _have_code_or_string = ...) -> None: ...
def distb(tb: types.TracebackType = ...) -> None: ...
def disassemble(co: _have_code, lasti: int = ...) -> None: ...
+63 -63
View File
@@ -1,11 +1,11 @@
from typing import Any, Callable, List, 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]
) -> List[str]: ...
def gen_preprocess_options(macros: List[_Macro], include_dirs: List[str]) -> List[str]: ...
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ...
def get_default_compiler(osname: str | None = ..., platform: str | None = ...) -> str: ...
def new_compiler(
plat: str | None = ..., compiler: str | None = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
@@ -17,34 +17,34 @@ class CCompiler:
force: bool
verbose: bool
output_dir: str | None
macros: List[_Macro]
include_dirs: List[str]
libraries: List[str]
library_dirs: List[str]
runtime_library_dirs: List[str]
objects: List[str]
macros: list[_Macro]
include_dirs: list[str]
libraries: list[str]
library_dirs: list[str]
runtime_library_dirs: list[str]
objects: list[str]
def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ...
def add_include_dir(self, dir: str) -> None: ...
def set_include_dirs(self, dirs: List[str]) -> None: ...
def set_include_dirs(self, dirs: list[str]) -> None: ...
def add_library(self, libname: str) -> None: ...
def set_libraries(self, libnames: List[str]) -> None: ...
def set_libraries(self, libnames: list[str]) -> None: ...
def add_library_dir(self, dir: str) -> None: ...
def set_library_dirs(self, dirs: List[str]) -> None: ...
def set_library_dirs(self, dirs: list[str]) -> None: ...
def add_runtime_library_dir(self, dir: str) -> None: ...
def set_runtime_library_dirs(self, dirs: List[str]) -> None: ...
def set_runtime_library_dirs(self, dirs: list[str]) -> None: ...
def define_macro(self, name: str, value: str | None = ...) -> None: ...
def undefine_macro(self, name: str) -> None: ...
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: List[str]) -> None: ...
def detect_language(self, sources: str | List[str]) -> str | None: ...
def find_library_file(self, dirs: List[str], lib: str, debug: bool = ...) -> str | None: ...
def set_link_objects(self, objects: list[str]) -> None: ...
def detect_language(self, sources: str | list[str]) -> str | None: ...
def find_library_file(self, dirs: list[str], lib: str, debug: bool = ...) -> str | None: ...
def has_function(
self,
funcname: str,
includes: List[str] | None = ...,
include_dirs: List[str] | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
includes: list[str] | None = ...,
include_dirs: list[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
@@ -52,18 +52,18 @@ class CCompiler:
def set_executables(self, **args: str) -> None: ...
def compile(
self,
sources: List[str],
sources: list[str],
output_dir: str | None = ...,
macros: _Macro | None = ...,
include_dirs: List[str] | None = ...,
include_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
depends: List[str] | None = ...,
) -> List[str]: ...
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
depends: list[str] | None = ...,
) -> list[str]: ...
def create_static_lib(
self,
objects: List[str],
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
debug: bool = ...,
@@ -72,59 +72,59 @@ class CCompiler:
def link(
self,
target_desc: str,
objects: List[str],
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_executable(
self,
objects: List[str],
objects: list[str],
output_progname: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_lib(
self,
objects: List[str],
objects: list[str],
output_libname: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
def link_shared_object(
self,
objects: List[str],
objects: list[str],
output_filename: str,
output_dir: str | None = ...,
libraries: List[str] | None = ...,
library_dirs: List[str] | None = ...,
runtime_library_dirs: List[str] | None = ...,
export_symbols: List[str] | None = ...,
libraries: list[str] | None = ...,
library_dirs: list[str] | None = ...,
runtime_library_dirs: list[str] | None = ...,
export_symbols: list[str] | None = ...,
debug: bool = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
build_temp: str | None = ...,
target_lang: str | None = ...,
) -> None: ...
@@ -132,17 +132,17 @@ class CCompiler:
self,
source: str,
output_file: str | None = ...,
macros: List[_Macro] | None = ...,
include_dirs: List[str] | None = ...,
extra_preargs: List[str] | None = ...,
extra_postargs: List[str] | None = ...,
macros: list[_Macro] | None = ...,
include_dirs: list[str] | None = ...,
extra_preargs: list[str] | None = ...,
extra_postargs: list[str] | None = ...,
) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
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 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 spawn(self, cmd: List[str]) -> 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: ...
def announce(self, msg: str, level: int = ...) -> None: ...
+9 -9
View File
@@ -1,9 +1,9 @@
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, List, Text, Tuple
from typing import Any, Callable, Iterable, Text
class Command:
sub_commands: List[Tuple[str, Callable[[Command], bool] | None]]
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]
def __init__(self, dist: Distribution) -> None: ...
@abstractmethod
def initialize_options(self) -> None: ...
@@ -14,15 +14,15 @@ class Command:
def announce(self, msg: Text, level: int = ...) -> None: ...
def debug_print(self, msg: Text) -> None: ...
def ensure_string(self, option: str, default: str | None = ...) -> None: ...
def ensure_string_list(self, option: str | List[str]) -> None: ...
def ensure_string_list(self, option: str | list[str]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ...
def set_undefined_options(self, src_cmd: Text, *option_pairs: tuple[str, str]) -> None: ...
def get_finalized_command(self, command: Text, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Command | Text, reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: Text) -> None: ...
def get_sub_commands(self) -> List[str]: ...
def get_sub_commands(self) -> list[str]: ...
def warn(self, msg: Text) -> None: ...
def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Text | None = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
@@ -34,7 +34,7 @@ class Command:
preserve_times: int = ...,
link: str | None = ...,
level: Any = ...,
) -> Tuple[str, bool]: ... # level is not used
) -> tuple[str, bool]: ... # level is not used
def copy_tree(
self,
infile: str,
@@ -43,7 +43,7 @@ class Command:
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
) -> List[str]: ... # level is not used
) -> list[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def make_archive(
@@ -57,10 +57,10 @@ class Command:
) -> str: ...
def make_file(
self,
infiles: str | List[str] | Tuple[str],
infiles: str | list[str] | tuple[str],
outfile: str,
func: Callable[..., Any],
args: List[Any],
args: list[Any],
exec_msg: str | None = ...,
skip_msg: str | None = ...,
level: Any = ...,
+4 -4
View File
@@ -3,14 +3,14 @@ from distutils.ccompiler import CCompiler
from distutils.core import Command as Command
from distutils.errors import DistutilsExecError as DistutilsExecError
from distutils.sysconfig import customize_compiler as customize_compiler
from typing import Dict, List, Pattern, Sequence, Tuple
from typing import Pattern, Sequence
LANG_EXT: Dict[str, str]
LANG_EXT: dict[str, str]
class config(Command):
description: str = ...
# Tuple is full name, short name, description
user_options: Sequence[Tuple[str, str | None, str]] = ...
user_options: Sequence[tuple[str, str | None, str]] = ...
compiler: str | CCompiler | None = ...
cc: str | None = ...
include_dirs: Sequence[str] | None = ...
@@ -74,7 +74,7 @@ class config(Command):
library_dirs: Sequence[str] | None = ...,
headers: Sequence[str] | None = ...,
include_dirs: Sequence[str] | None = ...,
other_libraries: List[str] = ...,
other_libraries: list[str] = ...,
) -> bool: ...
def check_header(
self, header: str, include_dirs: Sequence[str] | None = ..., library_dirs: Sequence[str] | None = ..., lang: str = ...
@@ -1,10 +1,10 @@
from distutils.cmd import Command
from typing import ClassVar, List, Tuple
from typing import ClassVar
class install_egg_info(Command):
description: ClassVar[str]
user_options: ClassVar[List[Tuple[str, str | None, str]]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
def get_outputs(self) -> List[str]: ...
def get_outputs(self) -> list[str]: ...
+2 -2
View File
@@ -1,8 +1,8 @@
from distutils.config import PyPIRCCommand
from typing import ClassVar, List, Tuple
from typing import ClassVar
class upload(PyPIRCCommand):
description: ClassVar[str]
boolean_options: ClassVar[List[str]]
boolean_options: ClassVar[list[str]]
def run(self) -> None: ...
def upload_file(self, command, pyversion, filename) -> None: ...
+3 -3
View File
@@ -1,6 +1,6 @@
from abc import abstractmethod
from distutils.cmd import Command
from typing import ClassVar, List, Tuple
from typing import ClassVar
DEFAULT_PYPIRC: str
@@ -9,8 +9,8 @@ class PyPIRCCommand(Command):
DEFAULT_REALM: ClassVar[str]
repository: None
realm: None
user_options: ClassVar[List[Tuple[str, str | None, str]]]
boolean_options: ClassVar[List[str]]
user_options: ClassVar[list[tuple[str, str | None, str]]]
boolean_options: ClassVar[list[str]]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
@abstractmethod
+22 -22
View File
@@ -1,7 +1,7 @@
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any, List, Mapping, Tuple, Type
from typing import Any, Mapping
def setup(
*,
@@ -15,34 +15,34 @@ def setup(
maintainer_email: str = ...,
url: str = ...,
download_url: str = ...,
packages: List[str] = ...,
py_modules: List[str] = ...,
scripts: List[str] = ...,
ext_modules: List[Extension] = ...,
classifiers: List[str] = ...,
distclass: Type[Distribution] = ...,
packages: list[str] = ...,
py_modules: list[str] = ...,
scripts: list[str] = ...,
ext_modules: list[Extension] = ...,
classifiers: list[str] = ...,
distclass: type[Distribution] = ...,
script_name: str = ...,
script_args: List[str] = ...,
script_args: list[str] = ...,
options: Mapping[str, Any] = ...,
license: str = ...,
keywords: List[str] | str = ...,
platforms: List[str] | str = ...,
cmdclass: Mapping[str, Type[Command]] = ...,
data_files: List[Tuple[str, List[str]]] = ...,
keywords: list[str] | str = ...,
platforms: list[str] | str = ...,
cmdclass: Mapping[str, type[Command]] = ...,
data_files: list[tuple[str, list[str]]] = ...,
package_dir: Mapping[str, str] = ...,
obsoletes: List[str] = ...,
provides: List[str] = ...,
requires: List[str] = ...,
command_packages: List[str] = ...,
command_options: Mapping[str, Mapping[str, Tuple[Any, Any]]] = ...,
package_data: Mapping[str, List[str]] = ...,
obsoletes: list[str] = ...,
provides: list[str] = ...,
requires: list[str] = ...,
command_packages: list[str] = ...,
command_options: Mapping[str, Mapping[str, tuple[Any, Any]]] = ...,
package_data: Mapping[str, list[str]] = ...,
include_package_data: bool = ...,
libraries: List[str] = ...,
headers: List[str] = ...,
libraries: list[str] = ...,
headers: list[str] = ...,
ext_package: str = ...,
include_dirs: List[str] = ...,
include_dirs: list[str] = ...,
password: str = ...,
fullname: str = ...,
**attrs: Any,
) -> None: ...
def run_setup(script_name: str, script_args: List[str] | None = ..., stop_after: str = ...) -> Distribution: ...
def run_setup(script_name: str, script_args: list[str] | None = ..., stop_after: str = ...) -> Distribution: ...
+2 -4
View File
@@ -1,5 +1,3 @@
from typing import List, Tuple
def newer(source: str, target: str) -> bool: ...
def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ...
def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ...
def newer_pairwise(sources: list[str], targets: list[str]) -> list[tuple[str, str]]: ...
def newer_group(sources: list[str], target: str, missing: str = ...) -> bool: ...
+3 -5
View File
@@ -1,7 +1,5 @@
from typing import List
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ...
def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> list[str]: ...
def create_tree(base_dir: str, files: list[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def copy_tree(
src: str,
dst: str,
@@ -11,5 +9,5 @@ def copy_tree(
update: int = ...,
verbose: int = ...,
dry_run: int = ...,
) -> List[str]: ...
) -> list[str]: ...
def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ...
+3 -3
View File
@@ -1,9 +1,9 @@
from distutils.cmd import Command
from typing import Any, Dict, Iterable, Mapping, Text, Tuple, Type
from typing import Any, Iterable, Mapping, Text
class Distribution:
cmdclass: Dict[str, Type[Command]]
cmdclass: dict[str, type[Command]]
def __init__(self, attrs: Mapping[str, Any] | None = ...) -> None: ...
def get_option_dict(self, command: str) -> Dict[str, Tuple[str, Text]]: ...
def get_option_dict(self, command: str) -> dict[str, tuple[str, Text]]: ...
def parse_config_files(self, filenames: Iterable[Text] | None = ...) -> None: ...
def get_command_obj(self, command: str, create: bool = ...) -> Command | None: ...
+12 -14
View File
@@ -1,21 +1,19 @@
from typing import List, Tuple
class Extension:
def __init__(
self,
name: str,
sources: List[str],
include_dirs: List[str] = ...,
define_macros: List[Tuple[str, str | None]] = ...,
undef_macros: List[str] = ...,
library_dirs: List[str] = ...,
libraries: List[str] = ...,
runtime_library_dirs: List[str] = ...,
extra_objects: List[str] = ...,
extra_compile_args: List[str] = ...,
extra_link_args: List[str] = ...,
export_symbols: List[str] = ...,
sources: list[str],
include_dirs: list[str] = ...,
define_macros: list[tuple[str, str | None]] = ...,
undef_macros: list[str] = ...,
library_dirs: list[str] = ...,
libraries: list[str] = ...,
runtime_library_dirs: list[str] = ...,
extra_objects: list[str] = ...,
extra_compile_args: list[str] = ...,
extra_link_args: list[str] = ...,
export_symbols: list[str] = ...,
swig_opts: str | None = ..., # undocumented
depends: List[str] = ...,
depends: list[str] = ...,
language: str = ...,
) -> None: ...
+11 -11
View File
@@ -1,21 +1,21 @@
from typing import Any, List, Mapping, Optional, Tuple, overload
from typing import Any, 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
) -> List[str] | _GR: ...
def wrap_text(text: str, width: int) -> List[str]: ...
options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: list[str] | None
) -> list[str] | _GR: ...
def wrap_text(text: str, width: int) -> list[str]: ...
class FancyGetopt:
def __init__(self, option_table: List[_Option] | None = ...) -> None: ...
def __init__(self, option_table: list[_Option] | None = ...) -> None: ...
# TODO kinda wrong, `getopt(object=object())` is invalid
@overload
def getopt(self, args: List[str] | None = ...) -> _GR: ...
def getopt(self, args: list[str] | None = ...) -> _GR: ...
@overload
def getopt(self, args: List[str] | None, object: Any) -> List[str]: ...
def get_option_order(self) -> List[Tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> List[str]: ...
def getopt(self, args: list[str] | None, object: Any) -> list[str]: ...
def get_option_order(self) -> list[tuple[str, str]]: ...
def generate_help(self, header: str | None = ...) -> list[str]: ...
class OptionDummy: ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Sequence, Tuple
from typing import Sequence
def copy_file(
src: str,
@@ -9,6 +9,6 @@ def copy_file(
link: str | None = ...,
verbose: bool = ...,
dry_run: bool = ...,
) -> Tuple[str, str]: ...
) -> tuple[str, str]: ...
def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ...
def write_file(filename: str, contents: Sequence[str]) -> None: ...
+1 -3
View File
@@ -1,4 +1,2 @@
from typing import List
def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def spawn(cmd: list[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def find_executable(executable: str, path: str | None = ...) -> str | None: ...
+3 -3
View File
@@ -1,4 +1,4 @@
from typing import IO, List, Tuple
from typing import IO
class TextFile:
def __init__(
@@ -15,7 +15,7 @@ class TextFile:
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(self, msg: str, line: List[int] | Tuple[int, int] | int = ...) -> None: ...
def warn(self, msg: str, line: list[int] | tuple[int, int] | int = ...) -> None: ...
def readline(self) -> str | None: ...
def readlines(self) -> List[str]: ...
def readlines(self) -> list[str]: ...
def unreadline(self, line: str) -> str: ...
+4 -4
View File
@@ -1,17 +1,17 @@
from typing import Any, Callable, List, Mapping, Tuple
from typing import Any, Callable, Mapping
def get_platform() -> str: ...
def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...
def check_environ() -> None: ...
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
def split_quoted(s: str) -> List[str]: ...
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(
py_files: List[str],
py_files: list[str],
optimize: int = ...,
force: bool = ...,
prefix: str | None = ...,
+4 -4
View File
@@ -1,6 +1,6 @@
from _typeshed import Self
from abc import abstractmethod
from typing import Pattern, Text, Tuple, TypeVar
from typing import Pattern, Text, TypeVar
_T = TypeVar("_T", bound=Version)
@@ -17,8 +17,8 @@ class Version:
class StrictVersion(Version):
version_re: Pattern[str]
version: Tuple[int, int, int]
prerelease: Tuple[Text, int] | None
version: tuple[int, int, int]
prerelease: tuple[Text, int] | None
def __init__(self, vstring: Text | None = ...) -> None: ...
def parse(self: Self, vstring: Text) -> Self: ...
def __str__(self) -> str: ...
@@ -27,7 +27,7 @@ class StrictVersion(Version):
class LooseVersion(Version):
component_re: Pattern[str]
vstring: Text
version: Tuple[Text | int, ...]
version: tuple[Text | int, ...]
def __init__(self, vstring: Text | None = ...) -> None: ...
def parse(self: Self, vstring: Text) -> Self: ...
def __str__(self) -> str: ...
+25 -25
View File
@@ -1,12 +1,12 @@
import types
import unittest
from typing import Any, Callable, Dict, List, NamedTuple, Tuple, Type
from typing import Any, Callable, NamedTuple
class TestResults(NamedTuple):
failed: int
attempted: int
OPTIONFLAGS_BY_NAME: Dict[str, int]
OPTIONFLAGS_BY_NAME: dict[str, int]
def register_optionflag(name: str) -> int: ...
@@ -34,7 +34,7 @@ class Example:
exc_msg: str | None
lineno: int
indent: int
options: Dict[int, bool]
options: dict[int, bool]
def __init__(
self,
source: str,
@@ -42,21 +42,21 @@ class Example:
exc_msg: str | None = ...,
lineno: int = ...,
indent: int = ...,
options: Dict[int, bool] | None = ...,
options: dict[int, bool] | None = ...,
) -> None: ...
def __hash__(self) -> int: ...
class DocTest:
examples: List[Example]
globs: Dict[str, Any]
examples: list[Example]
globs: dict[str, Any]
name: str
filename: str | None
lineno: int | None
docstring: str | None
def __init__(
self,
examples: List[Example],
globs: Dict[str, Any],
examples: list[Example],
globs: dict[str, Any],
name: str,
filename: str | None,
lineno: int | None,
@@ -66,9 +66,9 @@ class DocTest:
def __lt__(self, other: DocTest) -> bool: ...
class DocTestParser:
def parse(self, string: str, name: str = ...) -> List[str | Example]: ...
def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> List[Example]: ...
def parse(self, string: str, name: str = ...) -> list[str | Example]: ...
def get_doctest(self, string: str, globs: dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> list[Example]: ...
class DocTestFinder:
def __init__(
@@ -79,12 +79,12 @@ class DocTestFinder:
obj: object,
name: str | None = ...,
module: None | bool | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
extraglobs: Dict[str, Any] | None = ...,
) -> List[DocTest]: ...
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
) -> list[DocTest]: ...
_Out = Callable[[str], Any]
_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType]
_ExcInfo = tuple[type[BaseException], BaseException, types.TracebackType]
class DocTestRunner:
DIVIDER: str
@@ -127,11 +127,11 @@ master: DocTestRunner | None
def testmod(
m: types.ModuleType | None = ...,
name: str | None = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
exclude_empty: bool = ...,
) -> TestResults: ...
@@ -140,17 +140,17 @@ def testfile(
module_relative: bool = ...,
name: str | None = ...,
package: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
verbose: bool | None = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
raise_on_error: bool = ...,
parser: DocTestParser = ...,
encoding: str | None = ...,
) -> TestResults: ...
def run_docstring_examples(
f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ...
f: object, globs: dict[str, Any], verbose: bool = ..., name: str = ..., compileflags: int | None = ..., optionflags: int = ...
) -> None: ...
def set_unittest_reportflags(flags: int) -> int: ...
@@ -182,8 +182,8 @@ _DocTestSuite = unittest.TestSuite
def DocTestSuite(
module: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
extraglobs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
extraglobs: dict[str, Any] | None = ...,
test_finder: DocTestFinder | None = ...,
**options: Any,
) -> _DocTestSuite: ...
@@ -196,7 +196,7 @@ def DocFileTest(
path: str,
module_relative: bool = ...,
package: None | str | types.ModuleType = ...,
globs: Dict[str, Any] | None = ...,
globs: dict[str, Any] | None = ...,
parser: DocTestParser = ...,
encoding: str | None = ...,
**options: Any,
@@ -204,6 +204,6 @@ def DocFileTest(
def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ...
def script_from_examples(s: str) -> str: ...
def testsource(module: None | str | types.ModuleType, name: str) -> str: ...
def debug_src(src: str, pm: bool = ..., globs: Dict[str, Any] | None = ...) -> None: ...
def debug_script(src: str, pm: bool = ..., globs: Dict[str, Any] | None = ...) -> None: ...
def debug_src(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug_script(src: str, pm: bool = ..., globs: dict[str, Any] | None = ...) -> None: ...
def debug(module: None | str | types.ModuleType, name: str, pm: bool = ...) -> None: ...
+2 -2
View File
@@ -1,9 +1,9 @@
from typing import Any, Callable, Dict, NoReturn, Tuple
from typing import Any, Callable, NoReturn
class error(Exception):
def __init__(self, *args: Any) -> None: ...
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: ...
+2 -2
View File
@@ -1,7 +1,7 @@
from email.mime.nonmultipart import MIMENonMultipart
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__(
+2 -2
View File
@@ -1,11 +1,11 @@
import codecs
from typing import Text, Tuple
from typing import Text
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input: Text, final: bool = ...) -> bytes: ...
class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> Tuple[Text, int]: ...
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> tuple[Text, int]: ...
class StreamWriter(codecs.StreamWriter): ...
class StreamReader(codecs.StreamReader): ...
+16 -16
View File
@@ -1,11 +1,11 @@
from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Sequence, Text, Tuple
from typing import AnyStr, Callable, Generic, Iterable, Sequence, Text
DEFAULT_IGNORES: List[str]
DEFAULT_IGNORES: list[str]
def cmp(f1: bytes | Text, f2: bytes | Text, shallow: int | bool = ...) -> bool: ...
def cmpfiles(
a: AnyStr, b: AnyStr, common: Iterable[AnyStr], shallow: int | bool = ...
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
def __init__(
@@ -16,22 +16,22 @@ class dircmp(Generic[AnyStr]):
hide: Sequence[AnyStr]
ignore: Sequence[AnyStr]
# These properties are created at runtime by __getattr__
subdirs: Dict[AnyStr, dircmp[AnyStr]]
same_files: List[AnyStr]
diff_files: List[AnyStr]
funny_files: List[AnyStr]
common_dirs: List[AnyStr]
common_files: List[AnyStr]
common_funny: List[AnyStr]
common: List[AnyStr]
left_only: List[AnyStr]
right_only: List[AnyStr]
left_list: List[AnyStr]
right_list: List[AnyStr]
subdirs: dict[AnyStr, dircmp[AnyStr]]
same_files: list[AnyStr]
diff_files: list[AnyStr]
funny_files: list[AnyStr]
common_dirs: list[AnyStr]
common_files: list[AnyStr]
common_funny: list[AnyStr]
common: list[AnyStr]
left_only: list[AnyStr]
right_only: list[AnyStr]
left_list: list[AnyStr]
right_list: list[AnyStr]
def report(self) -> None: ...
def report_partial_closure(self) -> None: ...
def report_full_closure(self) -> None: ...
methodmap: Dict[str, Callable[[], None]]
methodmap: dict[str, Callable[[], None]]
def phase0(self) -> None: ...
def phase1(self) -> None: ...
def phase2(self) -> None: ...
+2 -2
View File
@@ -1,8 +1,8 @@
from typing import AnyStr, Iterable, List, Union
from typing import AnyStr, Iterable, Union
_EitherStr = Union[str, unicode]
def fnmatch(filename: _EitherStr, pattern: _EitherStr) -> bool: ...
def fnmatchcase(filename: _EitherStr, pattern: _EitherStr) -> bool: ...
def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> List[AnyStr]: ...
def filter(names: Iterable[AnyStr], pattern: _EitherStr) -> list[AnyStr]: ...
def translate(pattern: AnyStr) -> AnyStr: ...
+8 -8
View File
@@ -1,8 +1,8 @@
from typing import IO, Any, Iterable, List, 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
@@ -28,9 +28,9 @@ class NullFormatter:
class AbstractFormatter:
writer: NullWriter
align: str | None
align_stack: List[str | None]
font_stack: List[_FontType]
margin_stack: List[int]
align_stack: list[str | None]
font_stack: list[_FontType]
margin_stack: list[int]
spacing: str | None
style_stack: Any
nospace: int
@@ -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: ...

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