Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterable, List, TypeVar
from typing import Any, Iterable, TypeVar
from xml.etree.ElementTree import Element, ElementTree
from . import Markdown
@@ -6,7 +6,7 @@ from .util import Registry
_T = TypeVar("_T")
class State(List[_T]):
class State(list[_T]):
def set(self, state: _T) -> None: ...
def reset(self) -> None: ...
def isstate(self, state: _T) -> bool: ...

View File

@@ -1,7 +1,7 @@
from _typeshed import SupportsRead, SupportsWrite
from collections.abc import Iterable, Iterator, MutableMapping
from pathlib import Path
from typing import Any, Callable, Dict, Protocol, Sequence, SupportsBytes, Tuple, Union
from typing import Any, Callable, Protocol, Sequence, SupportsBytes, Union
from typing_extensions import Literal
from ._imaging import (
@@ -16,13 +16,13 @@ from .ImagePalette import ImagePalette
_Mode = Literal["1", "CMYK", "F", "HSV", "I", "L", "LAB", "P", "RGB", "RGBA", "RGBX", "YCbCr"]
_Resample = Literal[0, 1, 2, 3, 4, 5]
_Size = Tuple[int, int]
_Box = Tuple[int, int, int, int]
_Size = tuple[int, int]
_Box = tuple[int, int, int, int]
_ConversionMatrix = Union[
Tuple[float, float, float, float], Tuple[float, float, float, float, float, float, float, float, float, float, float, float],
tuple[float, float, float, float], tuple[float, float, float, float, float, float, float, float, float, float, float, float],
]
_Color = Union[float, Tuple[float, ...]]
_Color = Union[float, tuple[float, ...]]
class _Writeable(SupportsWrite[bytes], Protocol):
def seek(self, __offset: int) -> Any: ...
@@ -88,7 +88,7 @@ MODES: list[_Mode]
def getmodebase(mode: _Mode) -> Literal["L", "RGB"]: ...
def getmodetype(mode: _Mode) -> Literal["L", "I", "F"]: ...
def getmodebandnames(mode: _Mode) -> Tuple[str, ...]: ...
def getmodebandnames(mode: _Mode) -> tuple[str, ...]: ...
def getmodebands(mode: _Mode) -> int: ...
def preinit() -> None: ...
def init() -> None: ...
@@ -99,7 +99,7 @@ class _E:
def __add__(self, other) -> _E: ...
def __mul__(self, other) -> _E: ...
_ImageState = Tuple[Dict[str, Any], str, Tuple[int, int], Any, bytes]
_ImageState = tuple[dict[str, Any], str, tuple[int, int], Any, bytes]
class Image:
format: Any
@@ -149,7 +149,7 @@ class Image:
def crop(self, box: _Box | None = ...) -> Image: ...
def draft(self, mode: str, size: _Size) -> None: ...
def filter(self, filter: Filter | Callable[[], Filter]) -> Image: ...
def getbands(self) -> Tuple[str, ...]: ...
def getbands(self) -> tuple[str, ...]: ...
def getbbox(self) -> tuple[int, int, int, int] | None: ...
def getcolors(self, maxcolors: int = ...) -> list[tuple[int, int]]: ...
def getdata(self, band: int | None = ...): ...
@@ -197,7 +197,7 @@ class Image:
) -> None: ...
def seek(self, frame: int) -> None: ...
def show(self, title: str | None = ..., command: str | None = ...) -> None: ...
def split(self) -> Tuple[Image, ...]: ...
def split(self) -> tuple[Image, ...]: ...
def getchannel(self, channel: int | str) -> Image: ...
def tell(self) -> int: ...
def thumbnail(self, size: tuple[int, int], resample: _Resample = ..., reducing_gap: float = ...) -> None: ...
@@ -218,7 +218,7 @@ class Image:
class ImagePointHandler: ...
class ImageTransformHandler: ...
def new(mode: _Mode, size: tuple[int, int], color: float | Tuple[float, ...] | str = ...) -> Image: ...
def new(mode: _Mode, size: tuple[int, int], color: float | tuple[float, ...] | str = ...) -> Image: ...
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
def fromarray(obj, mode: _Mode | None = ...) -> Image: ...

View File

@@ -1,8 +1,8 @@
from typing import Tuple, Union
from typing import Union
_RGB = Union[Tuple[int, int, int], Tuple[int, int, int, int]]
_RGB = Union[tuple[int, int, int], tuple[int, int, int, int]]
_Ink = Union[str, int, _RGB]
_GreyScale = Tuple[int, int]
_GreyScale = tuple[int, int]
def getrgb(color: _Ink) -> _RGB: ...
def getcolor(color: _Ink, mode: str) -> _RGB | _GreyScale: ...

View File

@@ -1,12 +1,12 @@
from collections.abc import Container
from typing import Any, Sequence, Tuple, Union, overload
from typing import Any, Sequence, Union, overload
from typing_extensions import Literal
from .Image import Image
from .ImageColor import _Ink
from .ImageFont import _Font
_XY = Sequence[Union[float, Tuple[float, float]]]
_XY = Sequence[Union[float, tuple[float, float]]]
_Outline = Any
class ImageDraw:

View File

@@ -1,10 +1,10 @@
from _typeshed import Self
from typing import Any, Callable, Iterable, Sequence, Tuple, Type
from typing import Any, Callable, Iterable, Sequence, Type
from typing_extensions import Literal
from .Image import Image
_FilterArgs = Tuple[Sequence[int], int, int, Sequence[int]]
_FilterArgs = tuple[Sequence[int], int, int, Sequence[int]]
# filter image parameters below are the C images, i.e. Image().im.

View File

@@ -1,5 +1,5 @@
import collections
from typing import Any, List
from typing import Any
def encode_text(s: str) -> bytes: ...
@@ -44,7 +44,7 @@ class PdfName:
allowed_chars: Any
def __bytes__(self): ...
class PdfArray(List[Any]):
class PdfArray(list[Any]):
def __bytes__(self): ...
class PdfDict(collections.UserDict):

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict, NamedTuple, Tuple, Union
from typing import Any, NamedTuple, Union
from typing_extensions import Literal
class _TagInfo(NamedTuple):
@@ -36,7 +36,7 @@ DOUBLE: Literal[12]
IFD: Literal[13]
_TagType = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
_TagTuple = Union[Tuple[str, _TagType, int], Tuple[str, _TagInfo, int, Dict[str, int]]]
_TagTuple = Union[tuple[str, _TagType, int], tuple[str, _TagInfo, int, dict[str, int]]]
TAGS_V2: dict[int, _TagTuple]
TAGS_V2_GROUPS: dict[int, dict[int, _TagTuple]]

View File

@@ -1,5 +1,4 @@
import sys
from typing import FrozenSet
from .connections import Connection as Connection
from .constants import FIELD_TYPE as FIELD_TYPE
@@ -30,7 +29,7 @@ threadsafety: int
apilevel: str
paramstyle: str
class DBAPISet(FrozenSet[int]):
class DBAPISet(frozenset[int]):
def __ne__(self, other) -> bool: ...
def __eq__(self, other) -> bool: ...
def __hash__(self) -> int: ...

View File

@@ -1,5 +1,5 @@
from socket import socket as _socket
from typing import Any, AnyStr, Generic, Mapping, Tuple, Type, TypeVar, overload
from typing import Any, AnyStr, Generic, Mapping, Type, TypeVar, overload
from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name
from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS
@@ -35,7 +35,7 @@ class MysqlPacket:
def read_uint64(self) -> Any: ...
def read_length_encoded_integer(self) -> int: ...
def read_length_coded_string(self) -> bytes: ...
def read_struct(self, fmt: str) -> Tuple[Any, ...]: ...
def read_struct(self, fmt: str) -> tuple[Any, ...]: ...
def is_ok_packet(self) -> bool: ...
def is_eof_packet(self) -> bool: ...
def is_auth_switch_request(self) -> bool: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterable, Iterator, Text, Tuple, TypeVar
from typing import Any, Iterable, Iterator, Text, TypeVar
from .connections import Connection
@@ -6,7 +6,7 @@ _SelfT = TypeVar("_SelfT")
class Cursor:
connection: Connection[Any]
description: Tuple[Text, ...]
description: tuple[Text, ...]
rownumber: int
rowcount: int
arraysize: int
@@ -27,21 +27,21 @@ class Cursor:
def __enter__(self: _SelfT) -> _SelfT: ...
def __exit__(self, *exc_info: Any) -> None: ...
# Methods returning result tuples are below.
def fetchone(self) -> Tuple[Any, ...] | None: ...
def fetchmany(self, size: int | None = ...) -> Tuple[Tuple[Any, ...], ...]: ...
def fetchall(self) -> Tuple[Tuple[Any, ...], ...]: ...
def __iter__(self) -> Iterator[Tuple[Any, ...]]: ...
def fetchone(self) -> tuple[Any, ...] | None: ...
def fetchmany(self, size: int | None = ...) -> tuple[tuple[Any, ...], ...]: ...
def fetchall(self) -> tuple[tuple[Any, ...], ...]: ...
def __iter__(self) -> Iterator[tuple[Any, ...]]: ...
class DictCursorMixin:
dict_type: Any # TODO: add support if someone needs this
def fetchone(self) -> dict[Text, Any] | None: ...
def fetchmany(self, size: int | None = ...) -> Tuple[dict[Text, Any], ...]: ...
def fetchall(self) -> Tuple[dict[Text, Any], ...]: ...
def fetchmany(self, size: int | None = ...) -> tuple[dict[Text, Any], ...]: ...
def fetchall(self) -> tuple[dict[Text, Any], ...]: ...
def __iter__(self) -> Iterator[dict[Text, Any]]: ...
class SSCursor(Cursor):
def fetchall(self) -> list[Tuple[Any, ...]]: ... # type: ignore[override]
def fetchall_unbuffered(self) -> Iterator[Tuple[Any, ...]]: ...
def fetchall(self) -> list[tuple[Any, ...]]: ... # type: ignore[override]
def fetchall_unbuffered(self) -> Iterator[tuple[Any, ...]]: ...
def scroll(self, value: int, mode: Text = ...) -> None: ...
class DictCursor(DictCursorMixin, Cursor): ... # type: ignore[misc]

View File

@@ -1,5 +1,5 @@
from collections.abc import Iterable, Iterator, Sequence
from typing import Any, Tuple
from typing import Any
from pygments.token import _TokenType
from pygments.util import Future
@@ -40,7 +40,7 @@ class _inherit: ...
inherit: Any
class combined(Tuple[Any]):
class combined(tuple[Any]):
def __new__(cls, *args): ...
def __init__(self, *args) -> None: ...

View File

@@ -1,13 +1,13 @@
from _typeshed import StrOrBytesPath, StrPath
from collections.abc import Iterator
from typing import Any, Tuple, Union
from typing import Any, Union
from pygments.lexer import Lexer, LexerMeta
_OpenFile = Union[StrOrBytesPath, int] # copy/pasted from builtins.pyi
# TODO: use lower-case tuple once mypy updated
def get_all_lexers() -> Iterator[tuple[str, Tuple[str, ...], Tuple[str, ...], Tuple[str, ...]]]: ...
def get_all_lexers() -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ...
def find_lexer_class(name: str) -> LexerMeta | None: ...
def find_lexer_class_by_name(_alias: str) -> LexerMeta: ...
def get_lexer_by_name(_alias: str, **options: Any) -> Lexer: ...

View File

@@ -1,7 +1,6 @@
from collections.abc import Mapping
from typing import Tuple
class _TokenType(Tuple[str]): # TODO: change to lower-case tuple once new mypy released
class _TokenType(tuple[str]): # TODO: change to lower-case tuple once new mypy released
parent: _TokenType | None
def split(self) -> list[_TokenType]: ...
subtypes: set[_TokenType]

View File

@@ -1,5 +1,5 @@
from _typeshed import StrOrBytesPath
from typing import BinaryIO, Iterable, Tuple
from typing import BinaryIO, Iterable
from ..base import AsyncBase
@@ -31,7 +31,7 @@ class AsyncTextIOWrapper(AsyncBase[str]):
@property
def line_buffering(self) -> bool: ...
@property
def newlines(self) -> str | Tuple[str, ...] | None: ...
def newlines(self) -> str | tuple[str, ...] | None: ...
@property
def name(self) -> StrOrBytesPath | int: ...
@property

View File

@@ -1,10 +1,10 @@
from typing import Any, Tuple
from typing import Any
LC_CTYPE: Any
PLURALS: Any
DEFAULT_PLURAL: Any
class _PluralTuple(Tuple[int, str]):
class _PluralTuple(tuple[int, str]):
num_plurals: Any
plural_expr: Any
plural_forms: Any

View File

@@ -1,6 +1,6 @@
from collections.abc import Iterable, Iterator
from logging import Logger
from typing import Any, Tuple
from typing import Any
from typing_extensions import Literal
chardet_type: Any
@@ -77,7 +77,7 @@ class UnicodeDammit:
@property
def declared_html_encoding(self) -> str | None: ...
def find_codec(self, charset: str) -> str | None: ...
MS_CHARS: dict[bytes, str | Tuple[str, ...]]
MS_CHARS: dict[bytes, str | tuple[str, ...]]
MS_CHARS_TO_ASCII: dict[bytes, str]
WINDOWS_1252_TO_UTF8: dict[int, bytes]
MULTIBYTE_MARKERS_AND_SIZES: list[tuple[int, int, int]]

View File

@@ -1,6 +1,6 @@
from _typeshed import Self
from collections.abc import Iterator
from typing import Any, Callable, Generic, Iterable, List, Mapping, Pattern, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Generic, Iterable, Mapping, Pattern, Type, TypeVar, Union, overload
from . import BeautifulSoup
from .builder import TreeBuilder
@@ -53,7 +53,7 @@ class PageElement:
previousSibling: PageElement | None
@property
def stripped_strings(self) -> Iterator[str]: ...
def get_text(self, separator: str = ..., strip: bool = ..., types: Tuple[Type[NavigableString], ...] = ...) -> str: ...
def get_text(self, separator: str = ..., strip: bool = ..., types: tuple[Type[NavigableString], ...] = ...) -> str: ...
getText = get_text
@property
def text(self) -> str: ...
@@ -256,7 +256,7 @@ class Tag(PageElement):
can_be_empty_element: bool | None = ...,
cdata_list_attributes: list[str] | None = ...,
preserve_whitespace_tags: list[str] | None = ...,
interesting_string_types: Type[NavigableString] | Tuple[Type[NavigableString], ...] | None = ...,
interesting_string_types: Type[NavigableString] | tuple[Type[NavigableString], ...] | None = ...,
) -> None: ...
parserClass: Type[BeautifulSoup] | None
def __copy__(self: Self) -> Self: ...
@@ -267,7 +267,7 @@ class Tag(PageElement):
def string(self) -> str | None: ...
@string.setter
def string(self, string: str) -> None: ...
DEFAULT_INTERESTING_STRING_TYPES: Tuple[Type[NavigableString], ...]
DEFAULT_INTERESTING_STRING_TYPES: tuple[Type[NavigableString], ...]
@property
def strings(self) -> Iterable[str]: ...
def decompose(self) -> None: ...
@@ -348,6 +348,6 @@ class SoupStrainer:
searchTag = search_tag
def search(self, markup: PageElement | Iterable[PageElement]): ...
class ResultSet(List[_PageElementT], Generic[_PageElementT]):
class ResultSet(list[_PageElementT], Generic[_PageElementT]):
source: SoupStrainer
def __init__(self, source: SoupStrainer, result: Iterable[_PageElementT] = ...) -> None: ...

View File

@@ -1,5 +1,5 @@
from collections.abc import Callable, Container, Iterable
from typing import Any, Dict, List, Pattern, Union
from typing import Any, Pattern, Union
from .html5lib_shim import BleachHTMLParser, BleachHTMLSerializer, SanitizerFilter
@@ -39,8 +39,8 @@ class Cleaner(object):
def clean(self, text: str) -> str: ...
_AttributeFilter = Callable[[str, str, str], bool]
_AttributeDict = Union[Dict[str, Union[List[str], _AttributeFilter]], Dict[str, List[str]], Dict[str, _AttributeFilter]]
_Attributes = Union[_AttributeFilter, _AttributeDict, List[str]]
_AttributeDict = Union[dict[str, Union[list[str], _AttributeFilter]], dict[str, list[str]], dict[str, _AttributeFilter]]
_Attributes = Union[_AttributeFilter, _AttributeDict, list[str]]
def attribute_filter_factory(attributes: _Attributes) -> _AttributeFilter: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
class CORSRule:
allowed_method: Any
@@ -20,7 +20,7 @@ class CORSRule:
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...
class CORSConfiguration(List[CORSRule]):
class CORSConfiguration(list[CORSRule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self) -> str: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
class Rule:
id: Any
@@ -33,7 +33,7 @@ class Transition:
def __init__(self, days: Any | None = ..., date: Any | None = ..., storage_class: Any | None = ...) -> None: ...
def to_xml(self): ...
class Transitions(List[Transition]):
class Transitions(list[Transition]):
transition_properties: int
current_transition_property: int
temp_days: Any
@@ -51,7 +51,7 @@ class Transitions(List[Transition]):
@property
def storage_class(self): ...
class Lifecycle(List[Rule]):
class Lifecycle(list[Rule]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
class Tag:
key: Any
@@ -9,13 +9,13 @@ class Tag:
def to_xml(self): ...
def __eq__(self, other): ...
class TagSet(List[Tag]):
class TagSet(list[Tag]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def add_tag(self, key, value): ...
def to_xml(self): ...
class Tags(List[TagSet]):
class Tags(list[TagSet]):
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...
def to_xml(self): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
def tag(key, value): ...
@@ -33,7 +33,7 @@ class RedirectLocation(_XMLKeyValue):
def __init__(self, hostname: Any | None = ..., protocol: Any | None = ...) -> None: ...
def to_xml(self): ...
class RoutingRules(List[RoutingRule]):
class RoutingRules(list[RoutingRule]):
def add_rule(self, rule: RoutingRule) -> RoutingRules: ...
def startElement(self, name, attrs, connection): ...
def endElement(self, name, value, connection): ...

View File

@@ -3,7 +3,7 @@ import logging.handlers
import subprocess
import sys
import time
from typing import IO, Any, Callable, ContextManager, Dict, Iterable, Mapping, Sequence, Type, TypeVar
from typing import IO, Any, Callable, ContextManager, Iterable, Mapping, Sequence, Type, TypeVar
import boto.connection
@@ -50,7 +50,7 @@ def merge_meta(
def get_aws_metadata(headers: Mapping[str, str], provider: _Provider | None = ...) -> Mapping[str, str]: ...
def retry_url(url: str, retry_on_404: bool = ..., num_retries: int = ..., timeout: int | None = ...) -> str: ...
class LazyLoadMetadata(Dict[_KT, _VT]):
class LazyLoadMetadata(dict[_KT, _VT]):
def __init__(self, url: str, num_retries: int, timeout: int | None = ...) -> None: ...
def get_instance_metadata(
@@ -101,7 +101,7 @@ class AuthSMTPHandler(logging.handlers.SMTPHandler):
self, mailhost: str, username: str, password: str, fromaddr: str, toaddrs: Sequence[str], subject: str
) -> None: ...
class LRUCache(Dict[_KT, _VT]):
class LRUCache(dict[_KT, _VT]):
class _Item:
previous: LRUCache._Item | None
next: LRUCache._Item | None

View File

@@ -1,4 +1,4 @@
from typing import Hashable, Tuple
from typing import Hashable
def hashkey(*args: Hashable, **kwargs: Hashable) -> Tuple[Hashable, ...]: ...
def typedkey(*args: Hashable, **kwargs: Hashable) -> Tuple[Hashable, ...]: ...
def hashkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ...
def typedkey(*args: Hashable, **kwargs: Hashable) -> tuple[Hashable, ...]: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Tuple
from typing import Any
from .universaldetector import UniversalDetector as UniversalDetector
@@ -11,16 +11,16 @@ else:
from typing_extensions import TypedDict
class _LangModelType(TypedDict):
char_to_order_map: Tuple[int, ...]
precedence_matrix: Tuple[int, ...]
char_to_order_map: tuple[int, ...]
precedence_matrix: tuple[int, ...]
typical_positive_ratio: float
keep_english_letter: bool
charset_name: str
language: str
class _SMModelType(TypedDict):
class_table: Tuple[int, ...]
class_table: tuple[int, ...]
class_factor: int
state_table: Tuple[int, ...]
char_len_table: Tuple[int, ...]
state_table: tuple[int, ...]
char_len_table: tuple[int, ...]
name: str

View File

@@ -1,9 +1,7 @@
from typing import Tuple
from . import _LangModelType
Latin5_BulgarianCharToOrderMap: Tuple[int, ...]
win1251BulgarianCharToOrderMap: Tuple[int, ...]
BulgarianLangModel: Tuple[int, ...]
Latin5_BulgarianCharToOrderMap: tuple[int, ...]
win1251BulgarianCharToOrderMap: tuple[int, ...]
BulgarianLangModel: tuple[int, ...]
Latin5BulgarianModel: _LangModelType
Win1251BulgarianModel: _LangModelType

View File

@@ -1,14 +1,12 @@
from typing import Tuple
from . import _LangModelType
KOI8R_char_to_order_map: Tuple[int, ...]
win1251_char_to_order_map: Tuple[int, ...]
latin5_char_to_order_map: Tuple[int, ...]
macCyrillic_char_to_order_map: Tuple[int, ...]
IBM855_char_to_order_map: Tuple[int, ...]
IBM866_char_to_order_map: Tuple[int, ...]
RussianLangModel: Tuple[int, ...]
KOI8R_char_to_order_map: tuple[int, ...]
win1251_char_to_order_map: tuple[int, ...]
latin5_char_to_order_map: tuple[int, ...]
macCyrillic_char_to_order_map: tuple[int, ...]
IBM855_char_to_order_map: tuple[int, ...]
IBM866_char_to_order_map: tuple[int, ...]
RussianLangModel: tuple[int, ...]
Koi8rModel: _LangModelType
Win1251CyrillicModel: _LangModelType
Latin5CyrillicModel: _LangModelType

View File

@@ -1,9 +1,7 @@
from typing import Tuple
from . import _LangModelType
Latin7_char_to_order_map: Tuple[int, ...]
win1253_char_to_order_map: Tuple[int, ...]
GreekLangModel: Tuple[int, ...]
Latin7_char_to_order_map: tuple[int, ...]
win1253_char_to_order_map: tuple[int, ...]
GreekLangModel: tuple[int, ...]
Latin7GreekModel: _LangModelType
Win1253GreekModel: _LangModelType

View File

@@ -1,7 +1,5 @@
from typing import Tuple
from . import _LangModelType
WIN1255_CHAR_TO_ORDER_MAP: Tuple[int, ...]
HEBREW_LANG_MODEL: Tuple[int, ...]
WIN1255_CHAR_TO_ORDER_MAP: tuple[int, ...]
HEBREW_LANG_MODEL: tuple[int, ...]
Win1255HebrewModel: _LangModelType

View File

@@ -1,9 +1,7 @@
from typing import Tuple
from . import _LangModelType
Latin2_HungarianCharToOrderMap: Tuple[int, ...]
win1250HungarianCharToOrderMap: Tuple[int, ...]
HungarianLangModel: Tuple[int, ...]
Latin2_HungarianCharToOrderMap: tuple[int, ...]
win1250HungarianCharToOrderMap: tuple[int, ...]
HungarianLangModel: tuple[int, ...]
Latin2HungarianModel: _LangModelType
Win1250HungarianModel: _LangModelType

View File

@@ -1,7 +1,5 @@
from typing import Tuple
from . import _LangModelType
TIS620CharToOrderMap: Tuple[int, ...]
ThaiLangModel: Tuple[int, ...]
TIS620CharToOrderMap: tuple[int, ...]
ThaiLangModel: tuple[int, ...]
TIS620ThaiModel: _LangModelType

View File

@@ -1,7 +1,5 @@
from typing import Tuple
from . import _LangModelType
Latin5_TurkishCharToOrderMap: Tuple[int, ...]
TurkishLangModel: Tuple[int, ...]
Latin5_TurkishCharToOrderMap: tuple[int, ...]
TurkishLangModel: tuple[int, ...]
Latin5TurkishModel: _LangModelType

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import SupportsWrite
from typing import Any, Callable, Dict, Optional, Pattern, Sequence, TextIO, Tuple, Union
from typing import Any, Callable, Optional, Pattern, Sequence, TextIO, Union
if sys.platform == "win32":
from .winterm import WinTerm
@@ -20,7 +20,7 @@ class StreamWrapper:
def closed(self) -> bool: ...
_WinTermCall = Callable[[Optional[int], bool, bool], None]
_WinTermCallDict = Dict[int, Union[Tuple[_WinTermCall], Tuple[_WinTermCall, int], Tuple[_WinTermCall, int, bool]]]
_WinTermCallDict = dict[int, Union[tuple[_WinTermCall], tuple[_WinTermCall, int], tuple[_WinTermCall, int, bool]]]
class AnsiToWin32:
ANSI_CSI_RE: Pattern[str] = ...
@@ -40,6 +40,6 @@ class AnsiToWin32:
def write_and_convert(self, text: str) -> None: ...
def write_plain_text(self, text: str, start: int, end: int) -> None: ...
def convert_ansi(self, paramstring: str, command: str) -> None: ...
def extract_params(self, command: str, paramstring: str) -> Tuple[int, ...]: ...
def extract_params(self, command: str, paramstring: str) -> tuple[int, ...]: ...
def call_win32(self, command: str, params: Sequence[int]) -> None: ...
def convert_osc(self, text: str) -> str: ...

View File

@@ -1,5 +1,5 @@
import datetime
from typing import Any, Iterator, Text, Tuple, Type, TypeVar, Union
from typing import Any, Iterator, Text, Type, TypeVar, Union
from typing_extensions import Literal
_RetType = Union[Type[float], Type[datetime.datetime]]
@@ -12,7 +12,7 @@ class CroniterNotAlphaError(CroniterError): ...
class croniter(Iterator[Any]):
MONTHS_IN_YEAR: Literal[12]
RANGES: Tuple[tuple[int, int], ...]
RANGES: tuple[tuple[int, int], ...]
DAYS: tuple[
Literal[31],
Literal[28],
@@ -27,9 +27,9 @@ class croniter(Iterator[Any]):
Literal[30],
Literal[31],
]
ALPHACONV: Tuple[dict[str, Any], ...]
LOWMAP: Tuple[dict[int, Any], ...]
LEN_MEANS_ALL: Tuple[int, ...]
ALPHACONV: tuple[dict[str, Any], ...]
LOWMAP: tuple[dict[int, Any], ...]
LEN_MEANS_ALL: tuple[int, ...]
bad_length: str
tzinfo: datetime.tzinfo | None
cur: float

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Generic, Iterable, Mapping, Tuple, Type, TypeVar, overload
from typing import Any, Callable, Generic, Iterable, Mapping, Type, TypeVar, overload
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -15,7 +15,7 @@ def asdict(obj: Any) -> dict[str, Any]: ...
@overload
def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ...
@overload
def astuple(obj: Any) -> Tuple[Any, ...]: ...
def astuple(obj: Any) -> tuple[Any, ...]: ...
@overload
def astuple(obj: Any, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ...
@overload
@@ -66,7 +66,7 @@ def field(
def field(
*, init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[str, Any] | None = ...
) -> Any: ...
def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ...
def fields(class_or_instance: Any) -> tuple[Field[Any], ...]: ...
def is_dataclass(obj: Any) -> bool: ...
class FrozenInstanceError(AttributeError): ...
@@ -79,7 +79,7 @@ def make_dataclass(
cls_name: str,
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
bases: tuple[type, ...] = ...,
namespace: dict[str, Any] | None = ...,
init: bool = ...,
repr: bool = ...,

View File

@@ -1,7 +1,7 @@
import sys
from collections.abc import Mapping, Set as AbstractSet
from datetime import datetime
from typing import Any, Tuple, overload
from typing import Any, overload
if sys.version_info >= (3, 8):
from typing import Literal
@@ -11,14 +11,14 @@ else:
@overload
def search_dates(
text: str,
languages: list[str] | Tuple[str, ...] | AbstractSet[str] | None,
languages: list[str] | tuple[str, ...] | AbstractSet[str] | None,
settings: Mapping[Any, Any] | None,
add_detected_language: Literal[True],
) -> list[tuple[str, datetime, str]]: ...
@overload
def search_dates(
text: str,
languages: list[str] | Tuple[str, ...] | AbstractSet[str] | None = ...,
languages: list[str] | tuple[str, ...] | AbstractSet[str] | None = ...,
settings: Mapping[Any, Any] | None = ...,
add_detected_language: Literal[False] = ...,
) -> list[tuple[str, datetime]]: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Callable, Iterator, NamedTuple, Pattern, Text, Tuple, TypeVar
from typing import Any, Callable, Iterator, NamedTuple, Pattern, Text, TypeVar
_C = TypeVar("_C", bound=Callable[..., Any])
_Func = TypeVar("_Func", bound=Callable[..., Any])
@@ -14,7 +14,7 @@ else:
args: list[str]
varargs: str | None
varkw: str | None
defaults: Tuple[Any, ...]
defaults: tuple[Any, ...]
kwonlyargs: list[str]
kwonlydefaults: dict[str, Any]
annotations: dict[str, Any]
@@ -34,7 +34,7 @@ class FunctionMaker(object):
args: list[Text]
varargs: Text | None
varkw: Text | None
defaults: Tuple[Any, ...]
defaults: tuple[Any, ...]
kwonlyargs: list[Text]
kwonlydefaults: Text | None
shortsignature: Text | None
@@ -49,7 +49,7 @@ class FunctionMaker(object):
func: Callable[..., Any] | None = ...,
name: Text | None = ...,
signature: Text | None = ...,
defaults: Tuple[Any, ...] | None = ...,
defaults: tuple[Any, ...] | None = ...,
doc: Text | None = ...,
module: Text | None = ...,
funcdict: _dict[Text, Any] | None = ...,
@@ -64,7 +64,7 @@ class FunctionMaker(object):
obj: Any,
body: Text,
evaldict: _dict[Text, Any],
defaults: Tuple[Any, ...] | None = ...,
defaults: tuple[Any, ...] | None = ...,
doc: Text | None = ...,
module: Text | None = ...,
addsource: bool = ...,

View File

@@ -1,4 +1,4 @@
from typing import Any, ClassVar, NamedTuple, Tuple
from typing import Any, ClassVar, NamedTuple
__docformat__: str
__version__: str
@@ -23,19 +23,19 @@ class ApplicationError(Exception): ...
class DataError(ApplicationError): ...
class SettingsSpec:
settings_spec: ClassVar[Tuple[Any, ...]]
settings_spec: ClassVar[tuple[Any, ...]]
settings_defaults: ClassVar[dict[Any, Any] | None]
settings_default_overrides: ClassVar[dict[Any, Any] | None]
relative_path_settings: ClassVar[Tuple[Any, ...]]
relative_path_settings: ClassVar[tuple[Any, ...]]
config_section: ClassVar[str | None]
config_section_dependencies: ClassVar[Tuple[str, ...] | None]
config_section_dependencies: ClassVar[tuple[str, ...] | None]
class TransformSpec:
def get_transforms(self) -> list[Any]: ...
default_transforms: ClassVar[Tuple[Any, ...]]
default_transforms: ClassVar[tuple[Any, ...]]
unknown_reference_resolvers: ClassVar[list[Any]]
class Component(SettingsSpec, TransformSpec):
component_type: ClassVar[str | None]
supported: ClassVar[Tuple[str, ...]]
supported: ClassVar[tuple[str, ...]]
def supports(self, format: str) -> bool: ...

View File

@@ -1,7 +1,7 @@
import optparse
from collections.abc import Iterable, Mapping
from configparser import RawConfigParser
from typing import Any, ClassVar, Tuple, Type
from typing import Any, ClassVar, Type
from docutils import SettingsSpec
from docutils.parsers import Parser
@@ -45,7 +45,7 @@ def validate_smartquotes_locales(
) -> list[tuple[str, str]]: ...
def make_paths_absolute(pathdict, keys, base_path: Any | None = ...) -> None: ...
def make_one_path_absolute(base_path, path) -> str: ...
def filter_settings_spec(settings_spec, *exclude, **replace) -> Tuple[Any, ...]: ...
def filter_settings_spec(settings_spec, *exclude, **replace) -> tuple[Any, ...]: ...
class Values(optparse.Values):
def update(self, other_dict, option_parser) -> None: ...

View File

@@ -1,6 +1,6 @@
from typing import ClassVar, Tuple
from typing import ClassVar
from docutils import parsers
class Parser(parsers.Parser):
config_section_dependencies: ClassVar[Tuple[str, ...]]
config_section_dependencies: ClassVar[tuple[str, ...]]

View File

@@ -1,11 +1,11 @@
from typing import Any, ClassVar, Tuple
from typing import Any, ClassVar
from typing_extensions import Literal
from docutils import parsers
from docutils.parsers.rst import states
class Parser(parsers.Parser):
config_section_dependencies: ClassVar[Tuple[str, ...]]
config_section_dependencies: ClassVar[tuple[str, ...]]
initial_state: Literal["Body", "RFC2822Body"]
state_classes: Any
inliner: Any

View File

@@ -1,11 +1,11 @@
from typing import Any, Callable, Dict, List, Tuple
from typing import Any, Callable
import docutils.nodes
import docutils.parsers.rst.states
_RoleFn = Callable[
[str, str, str, int, docutils.parsers.rst.states.Inliner, Dict[str, Any], List[str]],
Tuple[List[docutils.nodes.reference], List[docutils.nodes.reference]],
[str, str, str, int, docutils.parsers.rst.states.Inliner, dict[str, Any], list[str]],
tuple[list[docutils.nodes.reference], list[docutils.nodes.reference]],
]
def register_local_role(name: str, role_fn: _RoleFn) -> None: ...

View File

@@ -1,8 +1,8 @@
import argparse
import ast
from typing import Any, Generic, Iterable, Iterator, Tuple, Type, TypeVar
from typing import Any, Generic, Iterable, Iterator, Type, TypeVar
FLAKE8_ERROR = Tuple[int, int, str, Type[Any]]
FLAKE8_ERROR = tuple[int, int, str, Type[Any]]
TConfig = TypeVar("TConfig") # noqa: Y001
class Error:

View File

@@ -1,9 +1,9 @@
from typing import Any, Tuple
from typing import Any
from typing_extensions import Literal
_ImageFilter = Literal["AUTO", "FlateDecode", "DCTDecode", "JPXDecode"]
SUPPORTED_IMAGE_FILTERS: Tuple[_ImageFilter, ...]
SUPPORTED_IMAGE_FILTERS: tuple[_ImageFilter, ...]
def load_image(filename): ...

View File

@@ -1,5 +1,5 @@
from abc import ABC
from typing import Any, List
from typing import Any
def clear_empty_fields(d): ...
def create_dictionary_string(
@@ -29,7 +29,7 @@ def camel_case(property_name): ...
class PDFString(str):
def serialize(self): ...
class PDFArray(List[Any]):
class PDFArray(list[Any]):
def serialize(self): ...
class Destination(ABC):

View File

@@ -1,5 +1,5 @@
from collections.abc import Iterable
from typing import Any, Tuple
from typing import Any
from typing_extensions import Literal
_Unit = Literal["pt", "mm", "cm", "in"]
@@ -14,5 +14,5 @@ def convert_unit(
to_convert: float | Iterable[float | Iterable[Any]],
old_unit: str | float,
new_unit: str | float,
) -> float | Tuple[float, ...]: ...
) -> float | tuple[float, ...]: ...
def dochecks() -> None: ...

View File

@@ -1,14 +1,14 @@
import decimal
from _typeshed import ReadableBuffer
from datetime import date, datetime, time
from typing import Any, Sequence, Tuple, Type, overload
from typing import Any, Sequence, Type, overload
from typing_extensions import Literal
from .resultrow import ResultRow
apilevel: str
threadsafety: int
paramstyle: Tuple[str, ...]
paramstyle: tuple[str, ...]
connect = Connection
class Connection:
@@ -44,19 +44,19 @@ class LOB:
def read(self, size: int = ..., position: int = ...) -> str | bytes: ...
def write(self, object: str | bytes) -> int: ...
_Parameters = Sequence[Tuple[Any, ...]]
_Parameters = Sequence[tuple[Any, ...]]
class Cursor:
description: Tuple[Tuple[Any, ...], ...]
description: tuple[tuple[Any, ...], ...]
rowcount: int
statementhash: str | None
connection: Connection
arraysize: int
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def callproc(self, procname: str, parameters: Tuple[Any, ...] = ..., overview: bool = ...) -> Tuple[Any, ...]: ...
def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ...
def close(self) -> None: ...
def description_ext(self) -> Sequence[Tuple[Any, ...]]: ...
def execute(self, operation: str, parameters: Tuple[Any, ...]) -> bool: ...
def description_ext(self) -> Sequence[tuple[Any, ...]]: ...
def execute(self, operation: str, parameters: tuple[Any, ...]) -> bool: ...
def executemany(self, operation: str, parameters: _Parameters) -> Any: ...
def executemanyprepared(self, parameters: _Parameters) -> Any: ...
def executeprepared(self, parameters: _Parameters = ...) -> Any: ...
@@ -67,7 +67,7 @@ class Cursor:
def getwarning(self) -> Warning | None: ...
def haswarning(self) -> bool: ...
def nextset(self) -> None: ...
def parameter_description(self) -> Tuple[str, ...]: ...
def parameter_description(self) -> tuple[str, ...]: ...
@overload
def prepare(self, operation: str, newcursor: Literal[True]) -> Cursor: ...
@overload

View File

@@ -1,6 +1,6 @@
from typing import Any, Tuple
from typing import Any
class ResultRow:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
column_names: Tuple[str, ...]
column_values: Tuple[Any, ...]
column_names: tuple[str, ...]
column_values: tuple[Any, ...]

View File

@@ -1,10 +1,10 @@
import sys
from collections import OrderedDict
from typing import Any, Dict
from typing import Any
entitiesTrie: Any
if sys.version_info >= (3, 7):
attributeMap = Dict[Any, Any]
attributeMap = dict[Any, Any]
else:
attributeMap = OrderedDict[Any, Any]

View File

@@ -1,9 +1,9 @@
from collections.abc import Mapping
from typing import Any, Dict
from typing import Any
supports_lone_surrogates: bool
class MethodDispatcher(Dict[Any, Any]):
class MethodDispatcher(dict[Any, Any]):
default: Any
def __init__(self, items=...) -> None: ...
def __getitem__(self, key): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
Marker: Any
listElementsMap: Any
@@ -18,7 +18,7 @@ class Node:
def cloneNode(self) -> None: ...
def hasContent(self) -> None: ...
class ActiveFormattingElements(List[Any]):
class ActiveFormattingElements(list[Any]):
def append(self, node) -> None: ...
def nodesEqual(self, node1, node2): ...

View File

@@ -1,6 +1,6 @@
import http.client
from collections.abc import Generator
from typing import Any, Dict, TypeVar
from typing import Any, TypeVar
from .error import *
@@ -175,7 +175,7 @@ class Http:
connection_type: Any | None = ...,
): ...
class Response(Dict[str, Any]):
class Response(dict[str, Any]):
fromcache: bool
version: int
status: int

View File

@@ -1,4 +1,4 @@
from typing import Any, Tuple, Type
from typing import Any, Type
from typing_extensions import Literal
from .abstract.attrDef import AttrDef as AttrDef
@@ -98,7 +98,7 @@ HASHED_SALTED_SHA384: Literal["SALTED_SHA384"]
HASHED_SALTED_SHA512: Literal["SALTED_SHA512"]
HASHED_SALTED_MD5: Literal["SALTED_MD5"]
NUMERIC_TYPES: Tuple[Type[Any], ...]
INTEGER_TYPES: Tuple[Type[Any], ...]
STRING_TYPES: Tuple[Type[Any], ...]
SEQUENCE_TYPES: Tuple[Type[Any], ...]
NUMERIC_TYPES: tuple[Type[Any], ...]
INTEGER_TYPES: tuple[Type[Any], ...]
STRING_TYPES: tuple[Type[Any], ...]
SEQUENCE_TYPES: tuple[Type[Any], ...]

View File

@@ -1,4 +1,4 @@
from typing import Any, FrozenSet
from typing import Any
from MySQLdb import connections as connections, constants as constants, converters as converters, cursors as cursors
from MySQLdb._mysql import (
@@ -35,7 +35,7 @@ threadsafety: int
apilevel: str
paramstyle: str
class DBAPISet(FrozenSet[Any]):
class DBAPISet(frozenset[Any]):
def __eq__(self, other): ...
STRING: Any

View File

@@ -1,9 +1,9 @@
import builtins
from typing import Any, Tuple
from typing import Any
import MySQLdb._exceptions
version_info: Tuple[Any, ...]
version_info: tuple[Any, ...]
class DataError(MySQLdb._exceptions.DatabaseError): ...
class DatabaseError(MySQLdb._exceptions.Error): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict
from typing import Any
UNICODE_ASCII_CHARACTER_SET: str
CLIENT_ID_CHARACTER_SET: str
@@ -28,7 +28,7 @@ def add_params_to_uri(uri, params, fragment: bool = ...): ...
def safe_string_equals(a, b): ...
def to_unicode(data, encoding: str = ...): ...
class CaseInsensitiveDict(Dict[Any, Any]):
class CaseInsensitiveDict(dict[Any, Any]):
proxy: Any
def __init__(self, data) -> None: ...
def __contains__(self, k): ...

View File

@@ -1,6 +1,6 @@
from typing import Any, Dict
from typing import Any
class OAuth2Token(Dict[Any, Any]):
class OAuth2Token(dict[Any, Any]):
def __init__(self, params, old_scope: Any | None = ...) -> None: ...
@property
def scope_changed(self): ...

View File

@@ -1,6 +1,6 @@
from socket import _RetAddress, socket
from threading import Thread
from typing import Protocol, Tuple
from typing import Protocol
from paramiko.channel import Channel
from paramiko.message import Message
@@ -18,7 +18,7 @@ SSH2_AGENT_SIGN_RESPONSE: int
class AgentSSH:
def __init__(self) -> None: ...
def get_keys(self) -> Tuple[AgentKey, ...]: ...
def get_keys(self) -> tuple[AgentKey, ...]: ...
class AgentProxyThread(Thread):
def __init__(self, agent: _AgentProxy) -> None: ...

View File

@@ -1,11 +1,11 @@
from threading import Event
from typing import Callable, List, Tuple
from typing import Callable
from paramiko.pkey import PKey
from paramiko.ssh_gss import _SSH_GSSAuth
from paramiko.transport import Transport
_InteractiveCallback = Callable[[str, str, List[Tuple[str, bool]]], List[str]]
_InteractiveCallback = Callable[[str, str, list[tuple[str, bool]]], list[str]]
class AuthHandler:
transport: Transport

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Dict, Iterable, Pattern
from typing import IO, Any, Iterable, Pattern
from paramiko.ssh_exception import ConfigParseError as ConfigParseError, CouldNotCanonicalize as CouldNotCanonicalize
@@ -25,7 +25,7 @@ class LazyFqdn:
host: str | None
def __init__(self, config: SSHConfigDict, host: str | None = ...) -> None: ...
class SSHConfigDict(Dict[str, str]):
class SSHConfigDict(dict[str, str]):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def as_bool(self, key: str) -> bool: ...
def as_int(self, key: str) -> int: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, AnyStr, Generic, Iterable, Tuple
from typing import Any, AnyStr, Generic, Iterable
from paramiko.util import ClosingContextManager
@@ -15,7 +15,7 @@ class BufferedFile(ClosingContextManager, Generic[AnyStr]):
FLAG_LINE_BUFFERED: int
FLAG_UNIVERSAL_NEWLINE: int
newlines: None | AnyStr | Tuple[AnyStr, ...]
newlines: None | AnyStr | tuple[AnyStr, ...]
def __init__(self) -> None: ...
def __del__(self) -> None: ...
def __iter__(self) -> BufferedFile[Any]: ...

View File

@@ -1,5 +1,4 @@
import threading
from typing import Tuple
from paramiko.channel import Channel
from paramiko.message import Message
@@ -19,7 +18,7 @@ class ServerInterface:
def enable_auth_gssapi(self) -> bool: ...
def check_port_forward_request(self, address: str, port: int) -> int: ...
def cancel_port_forward_request(self, address: str, port: int) -> None: ...
def check_global_request(self, kind: str, msg: Message) -> bool | Tuple[bool | int | str, ...]: ...
def check_global_request(self, kind: str, msg: Message) -> bool | tuple[bool | int | str, ...]: ...
def check_channel_pty_request(
self, channel: Channel, term: bytes, width: int, height: int, pixelwidth: int, pixelheight: int, modes: bytes
) -> bool: ...

View File

@@ -1,7 +1,7 @@
from typing import Any, Tuple, Type
from typing import Any, Type
GSS_AUTH_AVAILABLE: bool
GSS_EXCEPTIONS: Tuple[Type[Exception], ...]
GSS_EXCEPTIONS: tuple[Type[Exception], ...]
def GSSAuth(auth_method: str, gss_deleg_creds: bool = ...) -> _SSH_GSSAuth: ...

View File

@@ -2,7 +2,7 @@ from logging import Logger
from socket import socket
from threading import Condition, Event, Lock, Thread
from types import ModuleType
from typing import Any, Callable, Iterable, Protocol, Sequence, Tuple, Type
from typing import Any, Callable, Iterable, Protocol, Sequence, Type
from paramiko.auth_handler import AuthHandler, _InteractiveCallback
from paramiko.channel import Channel
@@ -14,7 +14,7 @@ from paramiko.sftp_client import SFTPClient
from paramiko.ssh_gss import _SSH_GSSAuth
from paramiko.util import ClosingContextManager
_Addr = Tuple[str, int]
_Addr = tuple[str, int]
class _KexEngine(Protocol):
def start_kex(self) -> None: ...
@@ -67,7 +67,7 @@ class Transport(Thread, ClosingContextManager):
server_key_dict: dict[str, PKey]
server_accepts: list[Channel]
server_accept_cv: Condition
subsystem_table: dict[str, tuple[Type[SubsystemHandler], Tuple[Any, ...], dict[str, Any]]]
subsystem_table: dict[str, tuple[Type[SubsystemHandler], tuple[Any, ...], dict[str, Any]]]
sys: ModuleType
def __init__(
self,

View File

@@ -1,5 +1,5 @@
import textwrap
from typing import IO, Any, Callable, Generic, List, Text, Type, TypeVar, overload
from typing import IO, Any, Callable, Generic, Text, Type, TypeVar, overload
from typing_extensions import SupportsIndex
_TB = TypeVar("_TB", bound="_BaseEntry")
@@ -23,7 +23,7 @@ def detect_encoding(file: bytes | Text, binary_mode: bool = ...) -> str: ...
def escape(st: Text) -> Text: ...
def unescape(st: Text) -> Text: ...
class _BaseFile(List[_TB]):
class _BaseFile(list[_TB]):
fpath: Text
wrapwidth: int
encoding: Text

View File

@@ -1,6 +1,6 @@
import sys
from contextlib import AbstractContextManager
from typing import Any, Callable, Iterable, Iterator, Tuple, TypeVar
from typing import Any, Callable, Iterable, Iterator, TypeVar
from ._common import (
AIX as AIX,
@@ -125,7 +125,7 @@ class Process:
def pid(self) -> int: ...
def oneshot(self) -> AbstractContextManager[None]: ...
def as_dict(
self, attrs: list[str] | Tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
self, attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
) -> dict[str, Any]: ...
def parent(self) -> Process: ...
def parents(self) -> list[Process]: ...
@@ -188,7 +188,7 @@ class Popen(Process):
def pids() -> list[int]: ...
def pid_exists(pid: int) -> bool: ...
def process_iter(
attrs: list[str] | Tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
attrs: list[str] | tuple[str, ...] | set[str] | frozenset[str] | None = ..., ad_value: Any | None = ...
) -> Iterator[Process]: ...
def wait_procs(
procs: Iterable[Process], timeout: float | None = ..., callback: Callable[[Process], Any] | None = ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Tuple, TypeVar, overload
from typing import Any, Callable, TypeVar, overload
import psycopg2
import psycopg2.extensions
@@ -360,9 +360,9 @@ class cursor:
def copy_to(self, file, table, sep=..., null=..., columns=...): ...
def execute(self, query, vars=...): ...
def executemany(self, query, vars_list): ...
def fetchall(self) -> list[Tuple[Any, ...]]: ...
def fetchmany(self, size=...) -> list[Tuple[Any, ...]]: ...
def fetchone(self) -> Tuple[Any, ...] | Any: ...
def fetchall(self) -> list[tuple[Any, ...]]: ...
def fetchmany(self, size=...) -> list[tuple[Any, ...]]: ...
def fetchone(self) -> tuple[Any, ...] | Any: ...
def mogrify(self, *args, **kwargs): ...
def nextset(self): ...
def scroll(self, value, mode=...): ...

View File

@@ -1,5 +1,5 @@
from collections import OrderedDict
from typing import Any, List
from typing import Any
from psycopg2._ipaddress import register_ipaddress as register_ipaddress
from psycopg2._json import (
@@ -45,7 +45,7 @@ class DictCursor(DictCursorBase):
def execute(self, query, vars: Any | None = ...): ...
def callproc(self, procname, vars: Any | None = ...): ...
class DictRow(List[Any]):
class DictRow(list[Any]):
def __init__(self, cursor) -> None: ...
def __getitem__(self, x): ...
def __setitem__(self, x, v) -> None: ...

View File

@@ -1,5 +1,5 @@
from datetime import datetime
from typing import Any, Callable, Iterable, Sequence, Text, Tuple, Union
from typing import Any, Callable, Iterable, Sequence, Text, Union
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey
@@ -118,7 +118,7 @@ class CRL:
@classmethod
def from_cryptography(cls, crypto_crl: CertificateRevocationList) -> CRL: ...
def get_issuer(self) -> X509Name: ...
def get_revoked(self) -> Tuple[Revoked, ...]: ...
def get_revoked(self) -> tuple[Revoked, ...]: ...
def set_lastUpdate(self, when: bytes) -> None: ...
def set_nextUpdate(self, when: bytes) -> None: ...
def set_version(self, version: int) -> None: ...
@@ -166,7 +166,7 @@ class PKCS7:
class PKCS12:
def __init__(self) -> None: ...
def export(self, passphrase: bytes | None = ..., iter: int = ..., maciter: int = ...) -> bytes: ...
def get_ca_certificates(self) -> Tuple[X509, ...]: ...
def get_ca_certificates(self) -> tuple[X509, ...]: ...
def get_certificate(self) -> X509: ...
def get_friendlyname(self) -> bytes | None: ...
def get_privatekey(self) -> PKey: ...

View File

@@ -1,4 +1,4 @@
from typing import Callable, Mapping, Optional, Sequence, Tuple, Union
from typing import Callable, Mapping, Optional, Sequence, Union
from typing_extensions import Final
paFloat32: Final[int] = ...
@@ -70,7 +70,7 @@ paMacCoreStreamInfo: PaMacCoreStreamInfo
_ChannelMap = Sequence[int]
_PaHostApiInfo = Mapping[str, Union[str, int]]
_PaDeviceInfo = Mapping[str, Union[str, int, float]]
_StreamCallback = Callable[[Optional[bytes], int, Mapping[str, float], int], Tuple[Optional[bytes], int]]
_StreamCallback = Callable[[Optional[bytes], int, Mapping[str, float], int], tuple[Optional[bytes], int]]
def get_format_from_width(width: int, unsigned: bool = ...) -> int: ...
def get_portaudio_version() -> int: ...

View File

@@ -1,6 +1,6 @@
# TODO(MichalPokorny): more precise types
from typing import Any, Text, Tuple
from typing import Any, Text
GLOBAL_ACK_EINTR: int
GLOBAL_ALL: int
@@ -14,7 +14,7 @@ def global_cleanup() -> None: ...
version: str
def version_info() -> tuple[int, str, int, str, int, str, int, str, Tuple[str, ...], Any, int, Any]: ...
def version_info() -> tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Any, int, Any]: ...
class error(Exception): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Iterable, Iterator, Text, TypeVar
from typing import Any, Callable, Iterable, Iterator, Text, TypeVar
from typing_extensions import TypedDict
_T = TypeVar("_T")
@@ -101,7 +101,7 @@ class PortScannerYield(PortScannerAsync):
def wait(self, timeout: int | None = ...) -> None: ...
def still_scanning(self) -> None: ... # type: ignore[override]
class PortScannerHostDict(Dict[str, Any]):
class PortScannerHostDict(dict[str, Any]):
def hostnames(self) -> list[_ResultHostNames]: ...
def hostname(self) -> str: ...
def state(self) -> str: ...

View File

@@ -5,7 +5,6 @@ from typing import (
Any,
Callable,
ClassVar,
Dict,
Generic,
Iterable,
Iterator,
@@ -39,7 +38,7 @@ SYM_EMPTY: bytes
EMPTY_RESPONSE: str
NEVER_DECODE: str
class CaseInsensitiveDict(Dict[_StrType, _VT]):
class CaseInsensitiveDict(dict[_StrType, _VT]):
def __init__(self, data: SupportsItems[_StrType, _VT]) -> None: ...
def update(self, data: SupportsItems[_StrType, _VT]) -> None: ... # type: ignore[override]
@overload

View File

@@ -1,5 +1,5 @@
from _typeshed import SupportsItems
from typing import IO, Any, Callable, Iterable, List, Mapping, MutableMapping, Optional, Text, Tuple, TypeVar, Union
from typing import IO, Any, Callable, Iterable, Mapping, MutableMapping, Optional, Text, TypeVar, Union
from . import adapters, auth as _auth, compat, cookies, exceptions, hooks, models, status_codes, structures, utils
from .models import Response
@@ -43,18 +43,18 @@ class SessionRedirectMixin:
def rebuild_proxies(self, prepared_request, proxies): ...
def should_strip_auth(self, old_url, new_url): ...
_Data = Union[None, Text, bytes, Mapping[str, Any], Mapping[Text, Any], Iterable[Tuple[Text, Optional[Text]]], IO[Any]]
_Data = Union[None, Text, bytes, Mapping[str, Any], Mapping[Text, Any], Iterable[tuple[Text, Optional[Text]]], IO[Any]]
_Hook = Callable[[Response], Any]
_Hooks = MutableMapping[Text, List[_Hook]]
_Hooks = MutableMapping[Text, list[_Hook]]
_HooksInput = MutableMapping[Text, Union[Iterable[_Hook], _Hook]]
_ParamsMappingKeyType = Union[Text, bytes, int, float]
_ParamsMappingValueType = Union[Text, bytes, int, float, Iterable[Union[Text, bytes, int, float]], None]
_Params = Union[
SupportsItems[_ParamsMappingKeyType, _ParamsMappingValueType],
Tuple[_ParamsMappingKeyType, _ParamsMappingValueType],
Iterable[Tuple[_ParamsMappingKeyType, _ParamsMappingValueType]],
tuple[_ParamsMappingKeyType, _ParamsMappingValueType],
Iterable[tuple[_ParamsMappingKeyType, _ParamsMappingValueType]],
Union[Text, bytes],
]
_TextMapping = MutableMapping[Text, Text]

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict, Generic, Iterable, Iterator, Mapping, MutableMapping, TypeVar
from typing import Any, Generic, Iterable, Iterator, Mapping, MutableMapping, TypeVar
_VT = TypeVar("_VT")
@@ -12,7 +12,7 @@ class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]):
def __len__(self) -> int: ...
def copy(self) -> CaseInsensitiveDict[_VT]: ...
class LookupDict(Dict[str, _VT]):
class LookupDict(dict[str, _VT]):
name: Any
def __init__(self, name: Any = ...) -> None: ...
def __getitem__(self, key: str) -> _VT | None: ... # type: ignore[override]

View File

@@ -1,6 +1,6 @@
from _typeshed import IdentityFunction
from logging import Logger
from typing import Any, Callable, Sequence, Tuple, Type, TypeVar
from typing import Any, Callable, Sequence, Type, TypeVar
_R = TypeVar("_R")
@@ -8,7 +8,7 @@ def retry_call(
f: Callable[..., _R],
fargs: Sequence[Any] | None = ...,
fkwargs: dict[str, Any] | None = ...,
exceptions: Type[Exception] | Tuple[Type[Exception], ...] = ...,
exceptions: Type[Exception] | tuple[Type[Exception], ...] = ...,
tries: int = ...,
delay: float = ...,
max_delay: float | None = ...,
@@ -17,7 +17,7 @@ def retry_call(
logger: Logger | None = ...,
) -> _R: ...
def retry(
exceptions: Type[Exception] | Tuple[Type[Exception], ...] = ...,
exceptions: Type[Exception] | tuple[Type[Exception], ...] = ...,
tries: int = ...,
delay: float = ...,
max_delay: float | None = ...,

View File

@@ -2,7 +2,7 @@ import importlib.abc
import types
import zipimport
from abc import ABCMeta
from typing import IO, Any, Callable, Generator, Iterable, Optional, Sequence, Tuple, TypeVar, Union, overload
from typing import IO, Any, Callable, Generator, Iterable, Optional, Sequence, TypeVar, Union, overload
LegacyVersion = Any # from packaging.version
Version = Any # from packaging.version
@@ -70,14 +70,14 @@ class Requirement:
unsafe_name: str
project_name: str
key: str
extras: Tuple[str, ...]
extras: tuple[str, ...]
specs: list[tuple[str, str]]
# TODO: change this to packaging.markers.Marker | None once we can import
# packaging.markers
marker: Any | None
@staticmethod
def parse(s: str | Iterable[str]) -> Requirement: ...
def __contains__(self, item: Distribution | str | Tuple[str, ...]) -> bool: ...
def __contains__(self, item: Distribution | str | tuple[str, ...]) -> bool: ...
def __eq__(self, other_requirement: Any) -> bool: ...
def load_entry_point(dist: _EPDistType, group: str, name: str) -> Any: ...
@@ -90,15 +90,15 @@ def get_entry_map(dist: _EPDistType, group: str) -> dict[str, EntryPoint]: ...
class EntryPoint:
name: str
module_name: str
attrs: Tuple[str, ...]
extras: Tuple[str, ...]
attrs: tuple[str, ...]
extras: tuple[str, ...]
dist: Distribution | None
def __init__(
self,
name: str,
module_name: str,
attrs: Tuple[str, ...] = ...,
extras: Tuple[str, ...] = ...,
attrs: tuple[str, ...] = ...,
extras: tuple[str, ...] = ...,
dist: Distribution | None = ...,
) -> None: ...
@classmethod
@@ -123,7 +123,7 @@ class Distribution(IResourceProvider, IMetadataProvider):
key: str
extras: list[str]
version: str
parsed_version: Tuple[str, ...]
parsed_version: tuple[str, ...]
py_version: str
platform: str | None
precedence: int
@@ -145,7 +145,7 @@ class Distribution(IResourceProvider, IMetadataProvider):
def from_filename(cls, filename: str, metadata: _MetadataType = ..., **kw: str | None | int) -> Distribution: ...
def activate(self, path: list[str] | None = ...) -> None: ...
def as_requirement(self) -> Requirement: ...
def requires(self, extras: Tuple[str, ...] = ...) -> list[Requirement]: ...
def requires(self, extras: tuple[str, ...] = ...) -> list[Requirement]: ...
def clone(self, **kw: str | int | None) -> Requirement: ...
def egg_name(self) -> str: ...
def __cmp__(self, other: Any) -> bool: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
from pkg_resources import Environment
from setuptools import Command, SetuptoolsDeprecationWarning
@@ -106,7 +106,7 @@ class RewritePthDistributions(PthDistributions):
prelude: Any
postlude: Any
class CommandSpec(List[str]):
class CommandSpec(list[str]):
options: Any
split_args: Any
@classmethod

View File

@@ -8,7 +8,7 @@ from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator
from functools import wraps as wraps
from importlib.util import spec_from_loader as spec_from_loader
from io import BytesIO as BytesIO, StringIO as StringIO
from typing import Any, AnyStr, NoReturn, Pattern, Tuple, Type, TypeVar, overload
from typing import Any, AnyStr, NoReturn, Pattern, Type, TypeVar, overload
from typing_extensions import Literal
from . import moves as moves
@@ -44,9 +44,9 @@ Iterator = object
def get_method_function(meth: types.MethodType) -> types.FunctionType: ...
def get_method_self(meth: types.MethodType) -> object | None: ...
def get_function_closure(fun: types.FunctionType) -> Tuple[types._Cell, ...] | None: ...
def get_function_closure(fun: types.FunctionType) -> tuple[types._Cell, ...] | None: ...
def get_function_code(fun: types.FunctionType) -> types.CodeType: ...
def get_function_defaults(fun: types.FunctionType) -> Tuple[Any, ...] | None: ...
def get_function_defaults(fun: types.FunctionType) -> tuple[Any, ...] | None: ...
def get_function_globals(fun: types.FunctionType) -> dict[str, Any]: ...
def iterkeys(d: Mapping[_K, Any]) -> _Iterator[_K]: ...
def itervalues(d: Mapping[Any, _V]) -> _Iterator[_V]: ...

View File

@@ -1,9 +1,9 @@
import json
from typing import Any, Dict
from typing import Any
from stripe import api_requestor as api_requestor
class StripeObject(Dict[Any, Any]):
class StripeObject(dict[Any, Any]):
class ReprJSONEncoder(json.JSONEncoder):
def default(self, obj): ...
def __init__(

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Container, Iterable, List, Mapping, NamedTuple, Sequence, Union
from typing import Any, Callable, Container, Iterable, Mapping, NamedTuple, Sequence, Union
LATEX_ESCAPE_RULES: dict[str, str]
MIN_PADDING: int
@@ -18,8 +18,8 @@ class DataRow(NamedTuple):
sep: str
end: str
_TableFormatLine = Union[None, Line, Callable[[List[int], List[str]], str]]
_TableFormatRow = Union[None, DataRow, Callable[[List[Any], List[int], List[str]], str]]
_TableFormatLine = Union[None, Line, Callable[[list[int], list[str]], str]]
_TableFormatRow = Union[None, DataRow, Callable[[list[Any], list[int], list[str]], str]]
class TableFormat(NamedTuple):
lineabove: _TableFormatLine

View File

@@ -1,4 +1,3 @@
import typing
from typing import Any, Iterator
class NodeVisitor:
@@ -15,7 +14,7 @@ def fix_missing_locations(node: AST) -> AST: ...
def get_docstring(node: AST, clean: bool = ...) -> bytes | None: ...
def increment_lineno(node: AST, n: int = ...) -> AST: ...
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ...
def literal_eval(node_or_string: str | AST) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
@@ -26,8 +25,8 @@ PyCF_ONLY_AST: int
identifier = str
class AST:
_attributes: typing.Tuple[str, ...]
_fields: typing.Tuple[str, ...]
_attributes: tuple[str, ...]
_fields: tuple[str, ...]
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class mod(AST): ...

View File

@@ -1,4 +1,3 @@
import typing
from typing import Any, Iterator
class NodeVisitor:
@@ -15,7 +14,7 @@ def fix_missing_locations(node: AST) -> AST: ...
def get_docstring(node: AST, clean: bool = ...) -> str | None: ...
def increment_lineno(node: AST, n: int = ...) -> AST: ...
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ...
def literal_eval(node_or_string: str | AST) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
@@ -26,8 +25,8 @@ PyCF_ONLY_AST: int
identifier = str
class AST:
_attributes: typing.Tuple[str, ...]
_fields: typing.Tuple[str, ...]
_attributes: tuple[str, ...]
_fields: tuple[str, ...]
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
class mod(AST): ...

View File

@@ -1,15 +1,15 @@
from datetime import timedelta
from typing import Any, Tuple
from typing import Any
from .base import Component
from .behavior import Behavior
DATENAMES: Tuple[str, ...]
RULENAMES: Tuple[str, ...]
DATESANDRULES: Tuple[str, ...]
DATENAMES: tuple[str, ...]
RULENAMES: tuple[str, ...]
DATESANDRULES: tuple[str, ...]
PRODID: str
WEEKDAYS: Tuple[str, ...]
FREQUENCIES: Tuple[str, ...]
WEEKDAYS: tuple[str, ...]
FREQUENCIES: tuple[str, ...]
zeroDelta: timedelta
twoHours: timedelta

View File

@@ -1,7 +1,7 @@
from typing import Any, Tuple
from typing import Any
from waitress.server import create_server as create_server
def serve(app: Any, **kw: Any) -> None: ...
def serve_paste(app: Any, global_conf: Any, **kw: Any) -> int: ...
def profile(cmd: Any, globals: Any, locals: Any, sort_order: Tuple[str, ...], callers: bool) -> None: ...
def profile(cmd: Any, globals: Any, locals: Any, sort_order: tuple[str, ...], callers: bool) -> None: ...