Use lowercase tuple where possible (#6170)

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

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Generator, Iterable, Iterator, Sequence, Tuple, overload
from typing import Any, Callable, Generator, Iterable, Iterator, Sequence, overload
_NDArray = Any # FIXME: no typings for numpy arrays
@@ -94,8 +94,8 @@ class Client:
@transport_frame.setter
def transport_frame(self, frame: int) -> None: ...
def transport_locate(self, frame: int) -> None: ...
def transport_query(self) -> Tuple[TransportState, dict[str, Any]]: ...
def transport_query_struct(self) -> Tuple[TransportState, _JackPositionT]: ...
def transport_query(self) -> tuple[TransportState, dict[str, Any]]: ...
def transport_query_struct(self) -> tuple[TransportState, _JackPositionT]: ...
def transport_reposition_struct(self, position: _JackPositionT) -> None: ... # TODO
def set_sync_timeout(self, timeout: int) -> None: ...
def set_freewheel(self, onoff: bool) -> None: ...
@@ -196,7 +196,7 @@ class OwnMidiPort(MidiPort, OwnPort):
def max_event_size(self) -> int: ...
@property
def lost_midi_events(self) -> int: ...
def incoming_midi_events(self) -> Generator[Tuple[int, _CBufferType], None, None]: ...
def incoming_midi_events(self) -> Generator[tuple[int, _CBufferType], None, None]: ...
def clear_buffer(self) -> None: ...
def write_midi_event(self, time: int, event: bytes | Sequence[int] | _CBufferType) -> None: ...
def reserve_midi_event(self, time: int, size: int) -> _CBufferType: ...
@@ -215,14 +215,14 @@ class RingBuffer:
def write_space(self) -> int: ...
def write(self, data: bytes | Iterable[int] | _CBufferType) -> int: ...
@property
def write_buffers(self) -> Tuple[_CBufferType, _CBufferType]: ...
def write_buffers(self) -> tuple[_CBufferType, _CBufferType]: ...
def write_advance(self, size: int) -> None: ...
@property
def read_space(self) -> int: ...
def read(self, size: int) -> _CBufferType: ...
def peek(self, size: int) -> _CBufferType: ...
@property
def read_buffers(self) -> Tuple[_CBufferType, _CBufferType]: ...
def read_buffers(self) -> tuple[_CBufferType, _CBufferType]: ...
def read_advance(self, size: int) -> None: ...
def mlock(self) -> None: ...
def reset(self, size: int | None = ...) -> None: ...
@@ -265,11 +265,11 @@ class TransportState:
class CallbackExit(Exception): ...
def get_property(subject: int | str, key: str) -> Tuple[bytes, str] | None: ...
def get_properties(subject: int | str) -> dict[str, Tuple[bytes, str]]: ...
def get_all_properties() -> dict[str, dict[str, Tuple[bytes, str]]]: ...
def get_property(subject: int | str, key: str) -> tuple[bytes, str] | None: ...
def get_properties(subject: int | str) -> dict[str, tuple[bytes, str]]: ...
def get_all_properties() -> dict[str, dict[str, tuple[bytes, str]]]: ...
def position2dict(pos: _JackPositionT) -> dict[str, Any]: ...
def version() -> Tuple[int, int, int, int]: ...
def version() -> tuple[int, int, int, int]: ...
def version_string() -> str: ...
def client_name_size() -> int: ...
def port_name_size() -> int: ...

View File

@@ -1,6 +1,6 @@
import sys
from types import ModuleType
from typing import Any, Callable, Iterable, Text, Tuple, Union
from typing import Any, Callable, Iterable, Text, Union
from .environment import Environment
@@ -24,7 +24,7 @@ class FileSystemLoader(BaseLoader):
encoding: Any
followlinks: Any
def __init__(self, searchpath: _SearchPath, encoding: Text = ..., followlinks: bool = ...) -> None: ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text, Callable[..., Any]]: ...
def list_templates(self): ...
class PackageLoader(BaseLoader):
@@ -34,33 +34,33 @@ class PackageLoader(BaseLoader):
provider: Any
package_path: Any
def __init__(self, package_name: Text, package_path: Text = ..., encoding: Text = ...) -> None: ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text, Callable[..., Any]]: ...
def list_templates(self): ...
class DictLoader(BaseLoader):
mapping: Any
def __init__(self, mapping) -> None: ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text, Callable[..., Any]]: ...
def list_templates(self): ...
class FunctionLoader(BaseLoader):
load_func: Any
def __init__(self, load_func) -> None: ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text | None, Callable[..., Any] | None]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text | None, Callable[..., Any] | None]: ...
class PrefixLoader(BaseLoader):
mapping: Any
delimiter: Any
def __init__(self, mapping, delimiter: str = ...) -> None: ...
def get_loader(self, template): ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text, Callable[..., Any]]: ...
def load(self, environment, name, globals: Any | None = ...): ...
def list_templates(self): ...
class ChoiceLoader(BaseLoader):
loaders: Any
def __init__(self, loaders) -> None: ...
def get_source(self, environment: Environment, template: Text) -> Tuple[Text, Text, Callable[..., Any]]: ...
def get_source(self, environment: Environment, template: Text) -> tuple[Text, Text, Callable[..., Any]]: ...
def load(self, environment, name, globals: Any | None = ...): ...
def list_templates(self): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Mapping, Tuple
from typing import Any, Mapping
from markdown.core import Markdown
@@ -7,7 +7,7 @@ class Extension:
def __init__(self, **kwargs: Any) -> None: ...
def getConfig(self, key: str, default: Any = ...) -> Any: ...
def getConfigs(self) -> dict[str, Any]: ...
def getConfigInfo(self) -> list[Tuple[str, str]]: ...
def getConfigInfo(self) -> list[tuple[str, str]]: ...
def setConfig(self, key: str, value: Any) -> None: ...
def setConfigs(self, items: Mapping[str, Any]) -> None: ...
def extendMarkdown(self, md: Markdown) -> None: ...

View File

@@ -1,5 +1,5 @@
import typing
from typing import Any, Match, Tuple
from typing import Any, Match
from xml.etree.ElementTree import Element
def build_inlinepatterns(md, **kwargs): ...
@@ -48,7 +48,7 @@ class Pattern:
class InlineProcessor(Pattern):
safe_mode: bool = ...
def __init__(self, pattern, md: Any | None = ...) -> None: ...
def handleMatch(self, m: Match[str], data) -> Tuple[Element, int, int] | Tuple[None, None, None]: ... # type: ignore
def handleMatch(self, m: Match[str], data) -> tuple[Element, int, int] | tuple[None, None, None]: ... # type: ignore
class SimpleTextPattern(Pattern): ...
class SimpleTextInlineProcessor(InlineProcessor): ...

View File

@@ -1,6 +1,6 @@
import string
import sys
from typing import Any, Callable, Iterable, Mapping, Sequence, Text, Tuple
from typing import Any, Callable, Iterable, Mapping, Sequence, Text
from typing_extensions import SupportsIndex
from markupsafe._compat import text_type
@@ -22,8 +22,8 @@ class Markup(text_type):
def striptags(self) -> Text: ...
@classmethod
def escape(cls, s: text_type) -> Markup: ... # noqa: F811
def partition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ...
def rpartition(self, sep: text_type) -> Tuple[Markup, Markup, Markup]: ...
def partition(self, sep: text_type) -> tuple[Markup, Markup, Markup]: ...
def rpartition(self, sep: text_type) -> tuple[Markup, Markup, Markup]: ...
def format(self, *args: Any, **kwargs: Any) -> Markup: ...
def __html_format__(self, format_spec: text_type) -> Markup: ...
def __getslice__(self, start: int, stop: int) -> Markup: ...

View File

@@ -1,12 +1,12 @@
import sys
from typing import Iterator, Mapping, Tuple, TypeVar
from typing import Iterator, Mapping, TypeVar
_K = TypeVar("_K")
_V = TypeVar("_V")
PY2: bool
def iteritems(d: Mapping[_K, _V]) -> Iterator[Tuple[_K, _V]]: ...
def iteritems(d: Mapping[_K, _V]) -> Iterator[tuple[_K, _V]]: ...
if sys.version_info >= (3,):
text_type = str

View File

@@ -1,5 +1,5 @@
import sys
from typing import FrozenSet, Tuple
from typing import FrozenSet
from .connections import Connection as Connection
from .constants import FIELD_TYPE as FIELD_TYPE
@@ -53,7 +53,7 @@ else:
def get_client_info() -> str: ...
__version__: str
version_info: Tuple[int, int, int, str, int]
version_info: tuple[int, int, int, str, int]
NULL: str
# pymysql/__init__.py says "Connect = connect = Connection = connections.Connection"

View File

@@ -2,7 +2,7 @@ import datetime
import sys
from _typeshed import SupportsItems
from types import BuiltinFunctionType, FunctionType, ModuleType
from typing import Any, Callable, ClassVar, Iterable, Mapping, NoReturn, Tuple, Type, TypeVar
from typing import Any, Callable, ClassVar, Iterable, Mapping, NoReturn, Type, TypeVar
from yaml.error import YAMLError as YAMLError
from yaml.nodes import MappingNode as MappingNode, Node as Node, ScalarNode as ScalarNode, SequenceNode as SequenceNode
@@ -33,7 +33,7 @@ class BaseRepresenter:
def represent_scalar(self, tag: str, value, style: str | None = ...) -> ScalarNode: ...
def represent_sequence(self, tag: str, sequence: Iterable[Any], flow_style: bool | None = ...) -> SequenceNode: ...
def represent_mapping(
self, tag: str, mapping: SupportsItems[Any, Any] | Iterable[Tuple[Any, Any]], flow_style: bool | None = ...
self, tag: str, mapping: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]], flow_style: bool | None = ...
) -> MappingNode: ...
def ignore_aliases(self, data) -> bool: ...
@@ -50,7 +50,7 @@ class SafeRepresenter(BaseRepresenter):
def represent_int(self, data: int) -> ScalarNode: ...
def represent_float(self, data: float) -> ScalarNode: ...
def represent_list(self, data: Iterable[Any]) -> SequenceNode: ...
def represent_dict(self, data: SupportsItems[Any, Any] | Iterable[Tuple[Any, Any]]) -> MappingNode: ...
def represent_dict(self, data: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]]) -> MappingNode: ...
def represent_set(self, data: Iterable[Any]) -> MappingNode: ...
def represent_date(self, data: datetime.date) -> ScalarNode: ...
def represent_datetime(self, data: datetime.datetime) -> ScalarNode: ...

View File

@@ -36,7 +36,7 @@ def native_itermethods(names): ...
class ImmutableListMixin(Generic[_V]):
def __hash__(self) -> int: ...
def __reduce_ex__(self: _D, protocol) -> Tuple[Type[_D], list[_V]]: ...
def __reduce_ex__(self: _D, protocol) -> tuple[Type[_D], list[_V]]: ...
def __delitem__(self, key: _V) -> NoReturn: ...
def __iadd__(self, other: Any) -> NoReturn: ...
def __imul__(self, other: Any) -> NoReturn: ...
@@ -280,17 +280,17 @@ class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict[_K, _V
class Accept(ImmutableList[Tuple[str, float]]):
provided: bool
def __init__(self, values: None | Accept | Iterable[Tuple[str, float]] = ...) -> None: ...
def __init__(self, values: None | Accept | Iterable[tuple[str, float]] = ...) -> None: ...
@overload
def __getitem__(self, key: SupportsIndex) -> Tuple[str, float]: ...
def __getitem__(self, key: SupportsIndex) -> tuple[str, float]: ...
@overload
def __getitem__(self, s: slice) -> list[Tuple[str, float]]: ...
def __getitem__(self, s: slice) -> list[tuple[str, float]]: ...
@overload
def __getitem__(self, key: str) -> float: ...
def quality(self, key: str) -> float: ...
def __contains__(self, value: str) -> bool: ... # type: ignore
def index(self, key: str | Tuple[str, float]) -> int: ... # type: ignore
def find(self, key: str | Tuple[str, float]) -> int: ...
def index(self, key: str | tuple[str, float]) -> int: ... # type: ignore
def find(self, key: str | tuple[str, float]) -> int: ...
def values(self) -> Iterator[str]: ...
def to_header(self) -> str: ...
@overload

View File

@@ -19,7 +19,7 @@ class HTTPException(Exception):
def name(self) -> str: ...
def get_description(self, environ: WSGIEnvironment | None = ...) -> Text: ...
def get_body(self, environ: WSGIEnvironment | None = ...) -> Text: ...
def get_headers(self, environ: WSGIEnvironment | None = ...) -> list[Tuple[str, str]]: ...
def get_headers(self, environ: WSGIEnvironment | None = ...) -> list[tuple[str, str]]: ...
def get_response(self, environ: WSGIEnvironment | _EnvironContainer | None = ...) -> Response: ...
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...

View File

@@ -25,7 +25,7 @@ def parse_form_data(
max_content_length: int | None = ...,
cls: Callable[[], _Dict] | None = ...,
silent: bool = ...,
) -> Tuple[IO[bytes], _Dict, _Dict]: ...
) -> tuple[IO[bytes], _Dict, _Dict]: ...
def exhaust_stream(f: _F) -> _F: ...
class FormDataParser(object):
@@ -47,10 +47,10 @@ class FormDataParser(object):
silent: bool = ...,
) -> None: ...
def get_parse_func(self, mimetype: str, options: Any) -> _ParseFunc | None: ...
def parse_from_environ(self, environ: WSGIEnvironment) -> Tuple[IO[bytes], _Dict, _Dict]: ...
def parse_from_environ(self, environ: WSGIEnvironment) -> tuple[IO[bytes], _Dict, _Dict]: ...
def parse(
self, stream: IO[bytes], mimetype: Text, content_length: int | None, options: Mapping[str, str] | None = ...
) -> Tuple[IO[bytes], _Dict, _Dict]: ...
) -> tuple[IO[bytes], _Dict, _Dict]: ...
parse_functions: dict[Text, _ParseFunc]
def is_valid_multipart_boundary(boundary: str) -> bool: ...
@@ -77,11 +77,11 @@ class MultiPartParser(object):
def get_part_charset(self, headers: Mapping[str, str]) -> Text: ...
def start_file_streaming(
self, filename: Text | bytes, headers: Mapping[str, str], total_content_length: int | None
) -> Tuple[Text, IO[bytes]]: ...
) -> tuple[Text, IO[bytes]]: ...
def in_memory_threshold_reached(self, bytes: Any) -> NoReturn: ...
def validate_boundary(self, boundary: str | None) -> None: ...
def parse_lines(
self, file: Any, boundary: bytes, content_length: int, cap_at_buffer: bool = ...
) -> Generator[Tuple[str, Any], None, None]: ...
def parse_parts(self, file: Any, boundary: bytes, content_length: int) -> Generator[Tuple[str, Any], None, None]: ...
def parse(self, file: Any, boundary: bytes, content_length: int) -> Tuple[_Dict, _Dict]: ...
) -> Generator[tuple[str, Any], None, None]: ...
def parse_parts(self, file: Any, boundary: bytes, content_length: int) -> Generator[tuple[str, Any], None, None]: ...
def parse(self, file: Any, boundary: bytes, content_length: int) -> tuple[_Dict, _Dict]: ...

View File

@@ -43,9 +43,9 @@ def parse_dict_header(value: bytes | Text) -> dict[Text, Text | None]: ...
@overload
def parse_dict_header(value: bytes | Text, cls: Type[_T]) -> _T: ...
@overload
def parse_options_header(value: None, multiple: bool = ...) -> Tuple[str, dict[str, str | None]]: ...
def parse_options_header(value: None, multiple: bool = ...) -> tuple[str, dict[str, str | None]]: ...
@overload
def parse_options_header(value: _Str) -> Tuple[_Str, dict[_Str, _Str | None]]: ...
def parse_options_header(value: _Str) -> tuple[_Str, dict[_Str, _Str | None]]: ...
# actually returns Tuple[_Str, dict[_Str, _Str | None], ...]
@overload
@@ -53,7 +53,7 @@ def parse_options_header(value: _Str, multiple: bool = ...) -> Tuple[Any, ...]:
@overload
def parse_accept_header(value: Text | None) -> Accept: ...
@overload
def parse_accept_header(value: _Str | None, cls: Callable[[list[Tuple[str, float]] | None], _T]) -> _T: ...
def parse_accept_header(value: _Str | None, cls: Callable[[list[tuple[str, float]] | None], _T]) -> _T: ...
@overload
def parse_cache_control_header(
value: None | bytes | Text, on_update: Callable[[RequestCacheControl], Any] | None = ...
@@ -75,7 +75,7 @@ def parse_content_range_header(
value: Text | None, on_update: Callable[[ContentRange], Any] | None = ...
) -> ContentRange | None: ...
def quote_etag(etag: _Str, weak: bool = ...) -> _Str: ...
def unquote_etag(etag: _Str | None) -> Tuple[_Str | None, _Str | None]: ...
def unquote_etag(etag: _Str | None) -> tuple[_Str | None, _Str | None]: ...
def parse_etags(value: Text | None) -> ETags: ...
def generate_etag(data: _ETagData) -> str: ...
def parse_date(value: str | None) -> datetime | None: ...
@@ -90,8 +90,8 @@ def is_resource_modified(
last_modified: None | Text | datetime = ...,
ignore_if_range: bool = ...,
) -> bool: ...
def remove_entity_headers(headers: list[Tuple[Text, Text]] | Headers, allowed: Iterable[Text] = ...) -> None: ...
def remove_hop_by_hop_headers(headers: list[Tuple[Text, Text]] | Headers) -> None: ...
def remove_entity_headers(headers: list[tuple[Text, Text]] | Headers, allowed: Iterable[Text] = ...) -> None: ...
def remove_hop_by_hop_headers(headers: list[tuple[Text, Text]] | Headers) -> None: ...
def is_entity_header(header: Text) -> bool: ...
def is_hop_by_hop_header(header: Text) -> bool: ...
@overload
@@ -103,7 +103,7 @@ def parse_cookie(
header: None | WSGIEnvironment | Text | bytes,
charset: Text = ...,
errors: Text = ...,
cls: Callable[[Iterable[Tuple[Text, Text]]], _T] | None = ...,
cls: Callable[[Iterable[tuple[Text, Text]]], _T] | None = ...,
) -> _T: ...
def dump_cookie(
key: _ToBytes,

View File

@@ -55,8 +55,8 @@ class LintMiddleware(object):
def __init__(self, app: WSGIApplication) -> None: ...
def check_environ(self, environ: WSGIEnvironment) -> None: ...
def check_start_response(
self, status: str, headers: list[Tuple[str, str]], exc_info: Tuple[Any, ...] | None
) -> Tuple[int, Headers]: ...
self, status: str, headers: list[tuple[str, str]], exc_info: Tuple[Any, ...] | None
) -> tuple[int, Headers]: ...
def check_headers(self, headers: Mapping[str, str]) -> None: ...
def check_iterator(self, app_iter: Iterable[bytes]) -> None: ...
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> GuardedIterator: ...

View File

@@ -1,12 +1,12 @@
from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment
from typing import IO, Iterable, Text, Tuple
from typing import IO, Iterable, Text
class ProfilerMiddleware(object):
def __init__(
self,
app: WSGIApplication,
stream: IO[str] = ...,
sort_by: Tuple[Text, Text] = ...,
sort_by: tuple[Text, Text] = ...,
restrictions: Iterable[str | float] = ...,
profile_dir: Text | None = ...,
filename_format: Text = ...,

View File

@@ -9,13 +9,13 @@ _Loader = Callable[[Optional[Text]], Union[Tuple[None, None], Tuple[Text, _Opene
class SharedDataMiddleware(object):
app: WSGIApplication
exports: list[Tuple[Text, _Loader]]
exports: list[tuple[Text, _Loader]]
cache: bool
cache_timeout: float
def __init__(
self,
app: WSGIApplication,
exports: Mapping[Text, _V] | Iterable[Tuple[Text, _V]],
exports: Mapping[Text, _V] | Iterable[tuple[Text, _V]],
disallow: Text | None = ...,
cache: bool = ...,
cache_timeout: float = ...,

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed.wsgi import WSGIEnvironment
from typing import Any, Generic, Text, Tuple, Type, TypeVar, overload
from typing import Any, Generic, Text, Type, TypeVar, overload
from typing_extensions import Literal
if sys.version_info >= (3, 0):
@@ -111,55 +111,55 @@ class Client(Generic[_R]):
def run_wsgi_app(self, environ, buffered: bool = ...): ...
def resolve_redirect(self, response, new_location, environ, buffered: bool = ...): ...
@overload
def open(self, *args, as_tuple: Literal[True], **kwargs) -> Tuple[WSGIEnvironment, _R]: ...
def open(self, *args, as_tuple: Literal[True], **kwargs) -> tuple[WSGIEnvironment, _R]: ...
@overload
def open(self, *args, as_tuple: Literal[False] = ..., **kwargs) -> _R: ...
@overload
def open(self, *args, as_tuple: bool, **kwargs) -> Any: ...
@overload
def get(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def get(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def get(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def get(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def patch(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def patch(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def patch(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def patch(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def post(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def post(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def post(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def post(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def head(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def head(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def head(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def head(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def put(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def put(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def put(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def put(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def delete(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def delete(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def delete(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def delete(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def options(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def options(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def options(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload
def options(self, *args, as_tuple: bool, **kw) -> Any: ...
@overload
def trace(self, *args, as_tuple: Literal[True], **kw) -> Tuple[WSGIEnvironment, _R]: ...
def trace(self, *args, as_tuple: Literal[True], **kw) -> tuple[WSGIEnvironment, _R]: ...
@overload
def trace(self, *args, as_tuple: Literal[False] = ..., **kw) -> _R: ...
@overload

View File

@@ -1,6 +1,6 @@
from _typeshed.wsgi import InputStream, WSGIEnvironment
from datetime import datetime, timedelta
from typing import Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence, Text, Tuple, Type, TypeVar, overload
from typing import Any, Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence, Text, Type, TypeVar, overload
from typing_extensions import Literal
from .datastructures import (
@@ -108,7 +108,7 @@ class BaseResponse:
self,
response: str | bytes | bytearray | Iterable[str] | Iterable[bytes] | None = ...,
status: Text | int | None = ...,
headers: Headers | Mapping[Text, Text] | Sequence[Tuple[Text, Text]] | None = ...,
headers: Headers | Mapping[Text, Text] | Sequence[tuple[Text, Text]] | None = ...,
mimetype: Text | None = ...,
content_type: Text | None = ...,
direct_passthrough: bool = ...,

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, Tuple, Type, TypeVar
from typing import IO, Any, Callable, ContextManager, Dict, Iterable, Mapping, Sequence, Type, TypeVar
import boto.connection
@@ -40,7 +40,7 @@ _LockType = Any # TODO replace this with _thread.LockType once stubs exist
JSONDecodeError: Type[ValueError]
qsa_of_interest: list[str]
def unquote_v(nv: str) -> str | Tuple[str, str]: ...
def unquote_v(nv: str) -> str | tuple[str, str]: ...
def canonical_string(
method: str, path: str, headers: Mapping[str, str | None], expires: int | None = ..., provider: _Provider | None = ...
) -> str: ...
@@ -68,7 +68,7 @@ ISO8601_MS: str
RFC1123: str
LOCALE_LOCK: _LockType
def setlocale(name: str | Tuple[str, str]) -> ContextManager[str]: ...
def setlocale(name: str | tuple[str, str]) -> ContextManager[str]: ...
def get_ts(ts: time.struct_time | None = ...) -> str: ...
def parse_ts(ts: str) -> datetime.datetime: ...
def find_class(module_name: str, class_name: str | None = ...) -> Type[Any] | None: ...
@@ -137,11 +137,11 @@ def get_utf8_value(value: str) -> bytes: ...
def mklist(value: Any) -> list[Any]: ...
def pythonize_name(name: str) -> str: ...
def write_mime_multipart(
content: list[Tuple[str, str]], compress: bool = ..., deftype: str = ..., delimiter: str = ...
content: list[tuple[str, str]], compress: bool = ..., deftype: str = ..., delimiter: str = ...
) -> str: ...
def guess_mime_type(content: str, deftype: str) -> str: ...
def compute_md5(fp: IO[Any], buf_size: int = ..., size: int | None = ...) -> Tuple[str, str, int]: ...
def compute_hash(fp: IO[Any], buf_size: int = ..., size: int | None = ..., hash_algorithm: Any = ...) -> Tuple[str, str, int]: ...
def compute_md5(fp: IO[Any], buf_size: int = ..., size: int | None = ...) -> tuple[str, str, int]: ...
def compute_hash(fp: IO[Any], buf_size: int = ..., size: int | None = ..., hash_algorithm: Any = ...) -> tuple[str, str, int]: ...
def find_matching_headers(name: str, headers: Mapping[str, str | None]) -> list[str]: ...
def merge_headers_by_name(name: str, headers: Mapping[str, str | None]) -> str: ...

View File

@@ -155,7 +155,7 @@ class MultiCommand(Command):
) -> None: ...
def resultcallback(self, replace: bool = ...) -> Callable[[_F], _F]: ...
def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None: ...
def resolve_command(self, ctx: Context, args: list[str]) -> Tuple[str, Command, list[str]]: ...
def resolve_command(self, ctx: Context, args: list[str]) -> tuple[str, Command, list[str]]: ...
def get_command(self, ctx: Context, cmd_name: str) -> Command | None: ...
def list_commands(self, ctx: Context) -> Iterable[str]: ...
@@ -227,8 +227,8 @@ class Parameter:
def full_process_value(self, ctx: Context, value: Any) -> Any: ...
def resolve_envvar_value(self, ctx: Context) -> str: ...
def value_from_envvar(self, ctx: Context) -> str | list[str]: ...
def handle_parse_result(self, ctx: Context, opts: dict[str, Any], args: list[str]) -> Tuple[Any, list[str]]: ...
def get_help_record(self, ctx: Context) -> Tuple[str, str]: ...
def handle_parse_result(self, ctx: Context, opts: dict[str, Any], args: list[str]) -> tuple[Any, list[str]]: ...
def get_help_record(self, ctx: Context) -> tuple[str, str]: ...
def get_usage_pieces(self, ctx: Context) -> list[str]: ...
def get_error_hint(self, ctx: Context) -> str: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import IdentityFunction
from distutils.version import Version
from typing import Any, Callable, Iterable, Text, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Iterable, Text, Type, TypeVar, Union, overload
from click.core import Argument, Command, Context, Group, Option, Parameter, _ConvertibleType
@@ -69,7 +69,7 @@ def argument(
expose_value: bool = ...,
is_eager: bool = ...,
envvar: str | list[str] | None = ...,
autocompletion: Callable[[Context, list[str], str], Iterable[str | Tuple[str, str]]] | None = ...,
autocompletion: Callable[[Context, list[str], str], Iterable[str | tuple[str, str]]] | None = ...,
) -> IdentityFunction: ...
@overload
def option(

View File

@@ -26,4 +26,4 @@ class HelpFormatter:
def indentation(self) -> ContextManager[None]: ...
def getvalue(self) -> str: ...
def join_options(options: list[str]) -> Tuple[str, bool]: ...
def join_options(options: list[str]) -> tuple[str, bool]: ...

View File

@@ -2,8 +2,8 @@ from typing import Any, Iterable, Set, Tuple
from click.core import Context
def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> Tuple[Tuple[Tuple[str, ...] | None, ...], list[str]]: ...
def split_opt(opt: str) -> Tuple[str, str]: ...
def _unpack_args(args: Iterable[str], nargs_spec: Iterable[int]) -> tuple[Tuple[Tuple[str, ...] | None, ...], list[str]]: ...
def split_opt(opt: str) -> tuple[str, str]: ...
def normalize_opt(opt: str, ctx: Context) -> str: ...
def split_arg_string(string: str) -> list[str]: ...
@@ -62,4 +62,4 @@ class OptionParser:
obj: Any | None = ...,
) -> None: ...
def add_argument(self, dest: str, nargs: int = ..., obj: Any | None = ...) -> None: ...
def parse_args(self, args: list[str]) -> Tuple[dict[str, Any], list[str], list[Any]]: ...
def parse_args(self, args: list[str]) -> tuple[dict[str, Any], list[str], list[Any]]: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Generator, Iterable, Text, Tuple, TypeVar, overload
from typing import IO, Any, Callable, Generator, Iterable, Text, TypeVar, overload
from click._termui_impl import ProgressBar as _ProgressBar
from click.core import _ConvertibleType
@@ -20,7 +20,7 @@ def prompt(
def confirm(
text: str, default: bool = ..., abort: bool = ..., prompt_suffix: str = ..., show_default: bool = ..., err: bool = ...
) -> bool: ...
def get_terminal_size() -> Tuple[int, int]: ...
def get_terminal_size() -> tuple[int, int]: ...
def echo_via_pager(
text_or_generator: str | Iterable[str] | Callable[[], Generator[str, None, None]], color: bool | None = ...
) -> None: ...

View File

@@ -1,5 +1,5 @@
import io
from typing import IO, Any, BinaryIO, ContextManager, Iterable, Mapping, Text, Tuple
from typing import IO, Any, BinaryIO, ContextManager, Iterable, Mapping, Text
from typing_extensions import Literal
from .core import BaseCommand
@@ -51,7 +51,7 @@ class CliRunner:
def make_env(self, overrides: Mapping[str, str] | None = ...) -> dict[str, str]: ...
def isolation(
self, input: bytes | Text | IO[Any] | None = ..., env: Mapping[str, str] | None = ..., color: bool = ...
) -> ContextManager[Tuple[io.BytesIO, io.BytesIO | Literal[False]]]: ...
) -> ContextManager[tuple[io.BytesIO, io.BytesIO | Literal[False]]]: ...
def invoke(
self,
cli: BaseCommand,

View File

@@ -11,7 +11,7 @@ class CroniterNotAlphaError(CroniterError): ...
class croniter(Iterator[Any]):
MONTHS_IN_YEAR: int
RANGES: Tuple[Tuple[int, int], ...]
RANGES: Tuple[tuple[int, int], ...]
DAYS: Tuple[int, ...]
ALPHACONV: Tuple[dict[str, Any], ...]
LOWMAP: Tuple[dict[int, Any], ...]
@@ -45,6 +45,6 @@ class croniter(Iterator[Any]):
def iter(self, ret_type: _RetType | None = ...) -> Iterator[Any]: ...
def is_leap(self, year: int) -> bool: ...
@classmethod
def expand(cls, expr_format: Text) -> Tuple[list[list[str]], dict[str, Any]]: ...
def expand(cls, expr_format: Text) -> tuple[list[list[str]], dict[str, Any]]: ...
@classmethod
def is_valid(cls, expression: Text) -> bool: ...

View File

@@ -1,5 +1,4 @@
from abc import ABCMeta, abstractmethod
from typing import Tuple
from cryptography.hazmat.backends.interfaces import RSABackend
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
@@ -52,7 +51,7 @@ def generate_private_key(
def rsa_crt_iqmp(p: int, q: int) -> int: ...
def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ...
def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ...
def rsa_recover_prime_factors(n: int, e: int, d: int) -> Tuple[int, int]: ...
def rsa_recover_prime_factors(n: int, e: int, d: int) -> tuple[int, int]: ...
class RSAPrivateNumbers(object):
def __init__(self, p: int, q: int, d: int, dmp1: int, dmq1: int, iqmp: int, public_numbers: RSAPublicNumbers) -> None: ...

View File

@@ -1,8 +1,6 @@
from typing import Tuple
from cryptography.hazmat.primitives.hashes import HashAlgorithm
def decode_dss_signature(signature: bytes) -> Tuple[int, int]: ...
def decode_dss_signature(signature: bytes) -> tuple[int, int]: ...
def encode_dss_signature(r: int, s: int) -> bytes: ...
class Prehashed(object):

View File

@@ -1,4 +1,4 @@
from typing import Any, Tuple
from typing import Any
from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKeyWithSerialization
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePrivateKeyWithSerialization
@@ -8,7 +8,7 @@ from cryptography.x509 import Certificate
def load_key_and_certificates(
data: bytes, password: bytes | None, backend: Any | None = ...
) -> Tuple[Any | None, Certificate | None, list[Certificate]]: ...
) -> tuple[Any | None, Certificate | None, list[Certificate]]: ...
def serialize_key_and_certificates(
name: bytes,
key: RSAPrivateKeyWithSerialization | EllipticCurvePrivateKeyWithSerialization | DSAPrivateKeyWithSerialization,

View File

@@ -13,7 +13,7 @@ MISSING: _MISSING_TYPE
@overload
def asdict(obj: Any) -> dict[str, Any]: ...
@overload
def asdict(obj: Any, *, dict_factory: Callable[[list[Tuple[str, Any]]], _T]) -> _T: ...
def asdict(obj: Any, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ...
@overload
def astuple(obj: Any) -> Tuple[Any, ...]: ...
@overload
@@ -77,7 +77,7 @@ class InitVar(Generic[_T]):
def make_dataclass(
cls_name: str,
fields: Iterable[str | Tuple[str, type] | Tuple[str, type, Field[Any]]],
fields: Iterable[str | tuple[str, type] | tuple[str, type, Field[Any]]],
*,
bases: Tuple[type, ...] = ...,
namespace: dict[str, Any] | None = ...,

View File

@@ -1,6 +1,6 @@
import datetime
import sys
from typing import Set, Tuple
from typing import Set
from dateparser.date import DateDataParser
@@ -34,9 +34,9 @@ class _Settings(TypedDict, total=False):
def parse(
date_string: str,
date_formats: list[str] | Tuple[str] | Set[str] | None = ...,
languages: list[str] | Tuple[str] | Set[str] | None = ...,
locales: list[str] | Tuple[str] | Set[str] | None = ...,
date_formats: list[str] | tuple[str] | Set[str] | None = ...,
languages: list[str] | tuple[str] | Set[str] | None = ...,
locales: list[str] | tuple[str] | Set[str] | None = ...,
region: str | None = ...,
settings: _Settings | None = ...,
) -> datetime.datetime | None: ...

View File

@@ -14,11 +14,11 @@ def search_dates(
languages: list[str] | Tuple[str, ...] | Set[str] | None,
settings: Mapping[Any, Any] | None,
add_detected_language: Literal[True],
) -> list[Tuple[str, datetime, str]]: ...
) -> list[tuple[str, datetime, str]]: ...
@overload
def search_dates(
text: str,
languages: list[str] | Tuple[str, ...] | Set[str] | None = ...,
settings: Mapping[Any, Any] | None = ...,
add_detected_language: Literal[False] = ...,
) -> list[Tuple[str, datetime]]: ...
) -> list[tuple[str, datetime]]: ...

View File

@@ -1,4 +1,4 @@
from typing import Pattern, Text, Tuple
from typing import Pattern, Text
from typing_extensions import Literal
_DEFAULT_DELIMITER: str
@@ -6,11 +6,11 @@ _DEFAULT_DELIMITER: str
def emojize(
string: str,
use_aliases: bool = ...,
delimiters: Tuple[str, str] = ...,
delimiters: tuple[str, str] = ...,
variant: Literal["text_type", "emoji_type", None] = ...,
language: str = ...,
) -> str: ...
def demojize(string: str, use_aliases: bool = ..., delimiters: Tuple[str, str] = ..., language: str = ...) -> str: ...
def demojize(string: str, use_aliases: bool = ..., delimiters: tuple[str, str] = ..., language: str = ...) -> str: ...
def get_emoji_regexp(language: str = ...) -> Pattern[Text]: ...
def emoji_lis(string: str, language: str = ...) -> list[dict[str, int | str]]: ...
def distinct_emoji_lis(string: str) -> list[str]: ...

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Self
from typing import Any, Iterator, Sequence, Text, Tuple, Type
from typing import Any, Iterator, Sequence, Text, Type
if sys.version_info >= (3, 0):
from configparser import ConfigParser
@@ -51,7 +51,7 @@ class Distribution:
def iter_files_distros(
path: Sequence[Text] | None = ..., repeated_distro: Text = ...
) -> Iterator[Tuple[ConfigParser, Distribution | None]]: ...
) -> Iterator[tuple[ConfigParser, Distribution | None]]: ...
def get_single(group: Text, name: Text, path: Sequence[Text] | None = ...) -> EntryPoint: ...
def get_group_named(group: Text, path: Sequence[Text] | None = ...) -> dict[str, EntryPoint]: ...
def get_group_all(group: Text, path: Sequence[Text] | None = ...) -> list[EntryPoint]: ...

View File

@@ -1,5 +1,5 @@
import collections
from typing import Any, Generic, Iterable, Iterator, Mapping, Tuple, Type, TypeVar, overload
from typing import Any, Generic, Iterable, Iterator, Mapping, Type, TypeVar, overload
_S = TypeVar("_S")
_KT = TypeVar("_KT")
@@ -13,7 +13,7 @@ class frozendict(Mapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self, mapping: Mapping[_KT, _VT]) -> None: ...
@overload
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
def __init__(self, iterable: Iterable[tuple[_KT, _VT]]) -> None: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __contains__(self, key: object) -> bool: ...
def copy(self: _S, **add_or_replace: _VT) -> _S: ...

View File

@@ -1,5 +1,5 @@
from datetime import datetime
from typing import IO, Any, Callable, Generator, Mapping, MutableMapping, Text, Tuple
from typing import IO, Any, Callable, Generator, Mapping, MutableMapping, Text
_serializer = Any # must be an object that has "dumps" and "loads" attributes (e.g. the json module)
@@ -107,14 +107,14 @@ class Serializer(object):
def dump(self, obj: Any, f: IO[Any], salt: Text | bytes | None = ...) -> None: ...
def loads(self, s: Text | bytes, salt: Text | bytes | None = ...) -> Any: ...
def load(self, f: IO[Any], salt: Text | bytes | None = ...) -> Any: ...
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ...) -> Tuple[bool, Any | None]: ...
def load_unsafe(self, f: IO[Any], salt: Text | bytes | None = ...) -> Tuple[bool, Any | None]: ...
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ...) -> tuple[bool, Any | None]: ...
def load_unsafe(self, f: IO[Any], salt: Text | bytes | None = ...) -> tuple[bool, Any | None]: ...
class TimedSerializer(Serializer):
def loads(
self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ..., return_timestamp: bool = ...
) -> Any: ... # morally -> Any | Tuple[Any, datetime]
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ...) -> Tuple[bool, Any]: ...
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., max_age: int | None = ...) -> tuple[bool, Any]: ...
class JSONWebSignatureSerializer(Serializer):
jws_algorithms: MutableMapping[Text, SigningAlgorithm] = ...
@@ -143,7 +143,7 @@ class JSONWebSignatureSerializer(Serializer):
def loads(
self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...
) -> Any: ... # morally -> Any | Tuple[Any, MutableMapping[str, Any]]
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...) -> Tuple[bool, Any]: ...
def loads_unsafe(self, s: Text | bytes, salt: Text | bytes | None = ..., return_header: bool = ...) -> tuple[bool, Any]: ...
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
DEFAULT_EXPIRES_IN: int = ...

View File

@@ -1,5 +1,3 @@
from typing import Tuple
from .mock import *
version_info: Tuple[int, int, int]
version_info: tuple[int, int, int]

View File

@@ -1,3 +1 @@
from typing import Tuple
__version_info__: Tuple[int, int, int]
__version_info__: tuple[int, int, int]

View File

@@ -26,11 +26,11 @@ class AgentProxyThread(Thread):
class AgentLocalProxy(AgentProxyThread):
def __init__(self, agent: AgentServerProxy) -> None: ...
def get_connection(self) -> Tuple[socket, _RetAddress]: ...
def get_connection(self) -> tuple[socket, _RetAddress]: ...
class AgentRemoteProxy(AgentProxyThread):
def __init__(self, agent: AgentClientProxy, chan: Channel) -> None: ...
def get_connection(self) -> Tuple[socket, _RetAddress]: ...
def get_connection(self) -> tuple[socket, _RetAddress]: ...
class AgentClientProxy:
thread: Thread

View File

@@ -1,6 +1,6 @@
from logging import Logger
from threading import Condition, Event, Lock
from typing import Any, Callable, Mapping, Tuple, TypeVar
from typing import Any, Callable, Mapping, TypeVar
from paramiko.buffered_pipe import BufferedPipe
from paramiko.file import BufferedFile
@@ -58,7 +58,7 @@ class Channel(ClosingContextManager):
auth_protocol: str | None = ...,
auth_cookie: str | None = ...,
single_connection: bool = ...,
handler: Callable[[Channel, Tuple[str, int]], None] | None = ...,
handler: Callable[[Channel, tuple[str, int]], None] | None = ...,
) -> bytes: ...
def request_forward_agent(self, handler: Callable[[Channel], None]) -> bool: ...
def get_transport(self) -> Transport: ...

View File

@@ -1,5 +1,5 @@
from socket import socket
from typing import Iterable, Mapping, NoReturn, Tuple, Type
from typing import Iterable, Mapping, NoReturn, Type
from paramiko.channel import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile
from paramiko.hostkeys import HostKeys
@@ -47,7 +47,7 @@ class SSHClient(ClosingContextManager):
timeout: float | None = ...,
get_pty: bool = ...,
environment: dict[str, str] | None = ...,
) -> Tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ...
) -> tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ...
def invoke_shell(
self,
term: str = ...,

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Tuple
from typing import IO, Any, Callable
from paramiko.message import Message
from paramiko.pkey import PKey
@@ -17,7 +17,7 @@ class DSSKey(PKey):
data: bytes | None = ...,
filename: str | None = ...,
password: str | None = ...,
vals: Tuple[int, int, int, int] | None = ...,
vals: tuple[int, int, int, int] | None = ...,
file_obj: IO[str] | None = ...,
) -> None: ...
def asbytes(self) -> bytes: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Sequence, Tuple, Type
from typing import IO, Any, Callable, Sequence, Type
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve, EllipticCurvePrivateKey, EllipticCurvePublicKey
from cryptography.hazmat.primitives.hashes import HashAlgorithm
@@ -32,7 +32,7 @@ class ECDSAKey(PKey):
data: bytes | None = ...,
filename: str | None = ...,
password: str | None = ...,
vals: Tuple[EllipticCurvePrivateKey, EllipticCurvePublicKey] | None = ...,
vals: tuple[EllipticCurvePrivateKey, EllipticCurvePublicKey] | None = ...,
file_obj: IO[str] | None = ...,
validate_point: bool = ...,
) -> None: ...

View File

@@ -1,7 +1,7 @@
import sys
from logging import Logger
from socket import socket
from typing import Any, Callable, Tuple
from typing import Any, Callable
from cryptography.hazmat.primitives.ciphers import Cipher
from paramiko.compress import ZlibCompressor, ZlibDecompressor
@@ -57,4 +57,4 @@ class Packetizer:
def write_all(self, out: bytes) -> None: ...
def readline(self, timeout: float) -> str: ...
def send_message(self, data: Message) -> None: ...
def read_message(self) -> Tuple[int, Message]: ...
def read_message(self) -> tuple[int, Message]: ...

View File

@@ -1,4 +1,4 @@
from typing import Protocol, Tuple
from typing import Protocol
class _BasePipe(Protocol):
def clear(self) -> None: ...
@@ -32,4 +32,4 @@ class OrPipe:
def set(self) -> None: ...
def clear(self) -> None: ...
def make_or_pipe(pipe: _Pipe) -> Tuple[OrPipe, OrPipe]: ...
def make_or_pipe(pipe: _Pipe) -> tuple[OrPipe, OrPipe]: ...

View File

@@ -1,8 +1,6 @@
from typing import Tuple
class ModulusPack:
pack: dict[int, list[Tuple[int, int]]]
discarded: list[Tuple[int, str]]
pack: dict[int, list[tuple[int, int]]]
discarded: list[tuple[int, str]]
def __init__(self) -> None: ...
def read_file(self, filename: str) -> None: ...
def get_modulus(self, min: int, prefer: int, max: int) -> Tuple[int, int]: ...
def get_modulus(self, min: int, prefer: int, max: int) -> tuple[int, int]: ...

View File

@@ -33,15 +33,15 @@ class ServerInterface:
self, channel: Channel, single_connection: bool, auth_protocol: str, auth_cookie: bytes, screen_number: int
) -> bool: ...
def check_channel_forward_agent_request(self, channel: Channel) -> bool: ...
def check_channel_direct_tcpip_request(self, chanid: int, origin: Tuple[str, int], destination: Tuple[str, int]) -> int: ...
def check_channel_direct_tcpip_request(self, chanid: int, origin: tuple[str, int], destination: tuple[str, int]) -> int: ...
def check_channel_env_request(self, channel: Channel, name: str, value: str) -> bool: ...
def get_banner(self) -> Tuple[str | None, str | None]: ...
def get_banner(self) -> tuple[str | None, str | None]: ...
class InteractiveQuery:
name: str
instructions: str
prompts: list[Tuple[str, bool]]
def __init__(self, name: str = ..., instructions: str = ..., *prompts: str | Tuple[str, bool]) -> None: ...
prompts: list[tuple[str, bool]]
def __init__(self, name: str = ..., instructions: str = ..., *prompts: str | tuple[str, bool]) -> None: ...
def add_prompt(self, prompt: str, echo: bool = ...) -> None: ...
class SubsystemHandler(threading.Thread):

View File

@@ -1,5 +1,5 @@
from logging import Logger
from typing import IO, Any, Callable, Iterator, Text, Tuple
from typing import IO, Any, Callable, Iterator, Text
from paramiko.channel import Channel
from paramiko.sftp import BaseSFTP
@@ -40,7 +40,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
def symlink(self, source: bytes | Text, dest: bytes | Text) -> None: ...
def chmod(self, path: bytes | Text, mode: int) -> None: ...
def chown(self, path: bytes | Text, uid: int, gid: int) -> None: ...
def utime(self, path: bytes | Text, times: Tuple[float, float] | None) -> None: ...
def utime(self, path: bytes | Text, times: tuple[float, float] | None) -> None: ...
def truncate(self, path: bytes | Text, size: int) -> None: ...
def readlink(self, path: bytes | Text) -> Text | None: ...
def normalize(self, path: bytes | Text) -> Text: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Iterator, Sequence, Tuple
from typing import Any, Iterator, Sequence
from paramiko.file import BufferedFile
from paramiko.sftp_attr import SFTPAttributes
@@ -21,9 +21,9 @@ class SFTPFile(BufferedFile[Any]):
def stat(self) -> SFTPAttributes: ...
def chmod(self, mode: int) -> None: ...
def chown(self, uid: int, gid: int) -> None: ...
def utime(self, times: Tuple[float, float] | None) -> None: ...
def utime(self, times: tuple[float, float] | None) -> None: ...
def truncate(self, size: int) -> None: ...
def check(self, hash_algorithm: str, offset: int = ..., length: int = ..., block_size: int = ...) -> bytes: ...
def set_pipelined(self, pipelined: bool = ...) -> None: ...
def prefetch(self, file_size: int | None = ...) -> None: ...
def readv(self, chunks: Sequence[Tuple[int, int]]) -> Iterator[bytes]: ...
def readv(self, chunks: Sequence[tuple[int, int]]) -> Iterator[bytes]: ...

View File

@@ -1,5 +1,5 @@
import socket
from typing import Mapping, Tuple
from typing import Mapping
from paramiko.pkey import PKey
@@ -33,9 +33,9 @@ class ProxyCommandFailure(SSHException):
def __init__(self, command: str, error: str) -> None: ...
class NoValidConnectionsError(socket.error):
errors: Mapping[Tuple[str, int] | Tuple[str, int, int, int], Exception]
def __init__(self, errors: Mapping[Tuple[str, int] | Tuple[str, int, int, int], Exception]) -> None: ...
def __reduce__(self) -> Tuple[type, Tuple[Mapping[Tuple[str, int] | Tuple[str, int, int, int], Exception]]]: ...
errors: Mapping[tuple[str, int] | tuple[str, int, int, int], Exception]
def __init__(self, errors: Mapping[tuple[str, int] | tuple[str, int, int, int], Exception]) -> None: ...
def __reduce__(self) -> tuple[type, tuple[Mapping[tuple[str, int] | tuple[str, int, int, int], Exception]]]: ...
class CouldNotCanonicalize(SSHException): ...
class ConfigParseError(SSHException): ...

View File

@@ -67,11 +67,11 @@ 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,
sock: str | Tuple[str, int] | socket,
sock: str | tuple[str, int] | socket,
default_window_size: int = ...,
default_max_packet_size: int = ...,
gss_kex: bool = ...,
@@ -156,7 +156,7 @@ class Transport(Thread, ClosingContextManager):
def set_hexdump(self, hexdump: bool) -> None: ...
def get_hexdump(self) -> bool: ...
def use_compression(self, compress: bool = ...) -> None: ...
def getpeername(self) -> Tuple[str, int]: ...
def getpeername(self) -> tuple[str, int]: ...
def stop_thread(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,5 +1,5 @@
import textwrap
from typing import IO, Any, Callable, Generic, List, Text, Tuple, Type, TypeVar, overload
from typing import IO, Any, Callable, Generic, List, Text, Type, TypeVar, overload
from typing_extensions import SupportsIndex
_TB = TypeVar("_TB", bound="_BaseEntry")
@@ -82,7 +82,7 @@ class _BaseEntry(object):
class POEntry(_BaseEntry):
comment: Text
tcomment: Text
occurrences: list[Tuple[str, int]]
occurrences: list[tuple[str, int]]
flags: list[Text]
previous_msgctxt: Text | None
previous_msgid: Text | None
@@ -108,7 +108,7 @@ class POEntry(_BaseEntry):
class MOEntry(_BaseEntry):
comment: Text
tcomment: Text
occurrences: list[Tuple[str, int]]
occurrences: list[tuple[str, int]]
flags: list[Text]
previous_msgctxt: Text | None
previous_msgid: Text | None
@@ -119,7 +119,7 @@ class MOEntry(_BaseEntry):
class _POFileParser(Generic[_TP]):
fhandle: IO[Text]
instance: _TP
transitions: dict[Tuple[str, str], Tuple[Callable[[], bool], str]]
transitions: dict[tuple[str, str], tuple[Callable[[], bool], str]]
current_line: int
current_entry: POEntry
current_state: str

View File

@@ -45,7 +45,7 @@ class X509Name:
emailAddress: Text
def __init__(self, name: X509Name) -> None: ...
def der(self) -> bytes: ...
def get_components(self) -> list[Tuple[bytes, bytes]]: ...
def get_components(self) -> list[tuple[bytes, bytes]]: ...
def hash(self) -> int: ...
class X509:

View File

@@ -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): ...
@@ -38,11 +38,11 @@ class CurlMulti(object):
def close(self) -> None: ...
def add_handle(self, obj: Curl) -> None: ...
def remove_handle(self, obj: Curl) -> None: ...
def perform(self) -> Tuple[Any, int]: ...
def fdset(self) -> Tuple[list[Any], list[Any], list[Any]]: ...
def perform(self) -> tuple[Any, int]: ...
def fdset(self) -> tuple[list[Any], list[Any], list[Any]]: ...
def select(self, timeout: float = ...) -> int: ...
def info_read(self, max_objects: int = ...) -> Tuple[int, list[Any], list[Any]]: ...
def socket_action(self, sockfd: int, ev_bitmask: int) -> Tuple[int, int]: ...
def info_read(self, max_objects: int = ...) -> tuple[int, list[Any], list[Any]]: ...
def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ...
class CurlShare(object):
def close(self) -> None: ...

View File

@@ -1,6 +1,6 @@
from stat import S_IMODE as S_IMODE
from types import TracebackType
from typing import IO, Any, Callable, ContextManager, Sequence, Text, Tuple, Type, Union
from typing import IO, Any, Callable, ContextManager, Sequence, Text, Type, Union
from typing_extensions import Literal
import paramiko
@@ -106,9 +106,9 @@ class Connection:
@property
def sftp_client(self) -> paramiko.SFTPClient: ...
@property
def active_ciphers(self) -> Tuple[str, str]: ...
def active_ciphers(self) -> tuple[str, str]: ...
@property
def active_compression(self) -> Tuple[str, str]: ...
def active_compression(self) -> tuple[str, str]: ...
@property
def security_options(self) -> paramiko.SecurityOptions: ...
@property

View File

@@ -1,5 +1,5 @@
from datetime import datetime, tzinfo
from typing import IO, Any, Mapping, Text, Tuple, Union
from typing import IO, Any, Mapping, Text, Union
from .isoparser import isoparse as isoparse, isoparser as isoparser
@@ -7,10 +7,10 @@ _FileOrStr = Union[bytes, Text, IO[str], IO[Any]]
class parserinfo(object):
JUMP: list[str]
WEEKDAYS: list[Tuple[str, str]]
MONTHS: list[Tuple[str, str]]
HMS: list[Tuple[str, str, str]]
AMPM: list[Tuple[str, str]]
WEEKDAYS: list[tuple[str, str]]
MONTHS: list[tuple[str, str]]
HMS: list[tuple[str, str, str]]
AMPM: list[tuple[str, str]]
UTCZONE: list[str]
PERTAIN: list[str]
TZOFFSET: dict[str, int]

View File

@@ -1,5 +1,5 @@
import datetime
from typing import IO, Any, Text, Tuple, Union
from typing import IO, Any, Text, Union
from ..relativedelta import relativedelta
from ._common import _tzinfo as _tzinfo, enfold as enfold, tzname_in_python2 as tzname_in_python2, tzrangebase as tzrangebase
@@ -73,7 +73,7 @@ class tzrange(tzrangebase):
start: relativedelta | None = ...,
end: relativedelta | None = ...,
) -> None: ...
def transitions(self, year: int) -> Tuple[datetime.datetime, datetime.datetime]: ...
def transitions(self, year: int) -> tuple[datetime.datetime, datetime.datetime]: ...
def __eq__(self, other): ...
class tzstr(tzrange):

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Dict, Iterable, Iterator, Text, Tuple, TypeVar
from typing import Any, Callable, Dict, Iterable, Iterator, Text, TypeVar
from typing_extensions import TypedDict
_T = TypeVar("_T")
@@ -52,7 +52,7 @@ __last_modification__: str
class PortScanner(object):
def __init__(self, nmap_search_path: Iterable[str] = ...) -> None: ...
def get_nmap_last_output(self) -> Text: ...
def nmap_version(self) -> Tuple[int, int]: ...
def nmap_version(self) -> tuple[int, int]: ...
def listscan(self, hosts: str = ...) -> list[str]: ...
def scan(
self, hosts: Text = ..., ports: Text | None = ..., arguments: Text = ..., sudo: bool = ..., timeout: int = ...
@@ -96,7 +96,7 @@ class PortScannerYield(PortScannerAsync):
def __init__(self) -> None: ...
def scan( # type: ignore
self, hosts: str = ..., ports: str | None = ..., arguments: str = ..., sudo: bool = ..., timeout: int = ...
) -> Iterator[Tuple[str, _Result]]: ...
) -> Iterator[tuple[str, _Result]]: ...
def stop(self) -> None: ...
def wait(self, timeout: int | None = ...) -> None: ...
def still_scanning(self) -> None: ... # type: ignore

View File

@@ -1,8 +1,8 @@
from typing import Sequence, Tuple
from typing import Sequence
def add_uppercase_char(char_list: Sequence[Tuple[str, str]]) -> Sequence[Tuple[str, str]]: ...
def add_uppercase_char(char_list: Sequence[tuple[str, str]]) -> Sequence[tuple[str, str]]: ...
CYRILLIC: Sequence[Tuple[str, str]]
GERMAN: Sequence[Tuple[str, str]]
GREEK: Sequence[Tuple[str, str]]
PRE_TRANSLATIONS: Sequence[Tuple[str, str]]
CYRILLIC: Sequence[tuple[str, str]]
GERMAN: Sequence[tuple[str, str]]
GREEK: Sequence[tuple[str, str]]
PRE_TRANSLATIONS: Sequence[tuple[str, str]]

View File

@@ -1,5 +1,5 @@
from datetime import datetime, timedelta
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, Sequence, Set, Text, Tuple, Type, TypeVar, Union, overload
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, Sequence, Set, Text, Type, TypeVar, Union, overload
from typing_extensions import Literal
from .connection import ConnectionPool
@@ -492,13 +492,13 @@ class Redis(Generic[_StrType]):
def unlink(self, *names: _Key) -> int: ...
def unwatch(self): ...
@overload
def blpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType]: ...
def blpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
@overload
def blpop(self, keys: _Value | Iterable[_Value], timeout: float) -> Tuple[_StrType, _StrType] | None: ...
def blpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
@overload
def brpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType]: ...
def brpop(self, keys: _Value | Iterable[_Value], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType]: ...
@overload
def brpop(self, keys: _Value | Iterable[_Value], timeout: float) -> Tuple[_StrType, _StrType] | None: ...
def brpop(self, keys: _Value | Iterable[_Value], timeout: float) -> tuple[_StrType, _StrType] | None: ...
def brpoplpush(self, src, dst, timeout=...): ...
def lindex(self, name: _Key, index: int) -> _StrType | None: ...
def linsert(
@@ -556,13 +556,13 @@ class Redis(Generic[_StrType]):
store: _Key,
groups: bool = ...,
) -> int: ...
def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> Tuple[int, list[_StrType]]: ...
def scan(self, cursor: int = ..., match: _Key | None = ..., count: int | None = ...) -> tuple[int, list[_StrType]]: ...
def scan_iter(self, match: Text | None = ..., count: int | None = ...) -> Iterator[_StrType]: ...
def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> Tuple[int, list[_StrType]]: ...
def sscan(self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...) -> tuple[int, list[_StrType]]: ...
def sscan_iter(self, name, match=..., count=...): ...
def hscan(
self, name: _Key, cursor: int = ..., match: Text = ..., count: int = ...
) -> Tuple[int, dict[_StrType, _StrType]]: ...
) -> tuple[int, dict[_StrType, _StrType]]: ...
def hscan_iter(self, name, match=..., count=...): ...
def zscan(self, name, cursor=..., match=..., count=..., score_cast_func=...): ...
def zscan_iter(self, name, match=..., count=..., score_cast_func=...): ...
@@ -618,13 +618,13 @@ class Redis(Generic[_StrType]):
def zpopmax(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
def zpopmin(self, name: _Key, count: int | None = ...) -> list[_StrType]: ...
@overload
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType, float]: ...
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
@overload
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float) -> Tuple[_StrType, _StrType, float] | None: ...
def bzpopmax(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
@overload
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> Tuple[_StrType, _StrType, float]: ...
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: Literal[0] = ...) -> tuple[_StrType, _StrType, float]: ...
@overload
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> Tuple[_StrType, _StrType, float] | None: ...
def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ...
@overload
def zrange(
self,
@@ -635,7 +635,7 @@ class Redis(Generic[_StrType]):
*,
withscores: Literal[True],
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrange(
self,
@@ -660,7 +660,7 @@ class Redis(Generic[_StrType]):
*,
withscores: Literal[True],
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrangebyscore(
self,
@@ -687,7 +687,7 @@ class Redis(Generic[_StrType]):
*,
withscores: Literal[True],
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrevrange(
self,
@@ -709,7 +709,7 @@ class Redis(Generic[_StrType]):
*,
withscores: Literal[True],
score_cast_func: Callable[[float], _ScoreCastFuncReturn] = ...,
) -> list[Tuple[_StrType, _ScoreCastFuncReturn]]: ...
) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ...
@overload
def zrevrangebyscore(
self,
@@ -757,7 +757,7 @@ class Redis(Generic[_StrType]):
def script_load(self, script): ...
def register_script(self, script: Text | _StrType) -> Script: ...
def pubsub_channels(self, pattern: _Key = ...) -> list[Text]: ...
def pubsub_numsub(self, *args: _Key) -> list[Tuple[Text, int]]: ...
def pubsub_numsub(self, *args: _Key) -> list[tuple[Text, int]]: ...
def pubsub_numpat(self) -> int: ...
def monitor(self) -> Monitor: ...
def memory_stats(self) -> dict[str, Any]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Mapping, Text, Tuple, Type
from typing import Any, Mapping, Text, Type
ssl_available: Any
hiredis_version: Any
@@ -105,7 +105,7 @@ class Connection:
def read_response(self): ...
def pack_command(self, *args): ...
def pack_commands(self, commands): ...
def repr_pieces(self) -> list[Tuple[Text, Text]]: ...
def repr_pieces(self) -> list[tuple[Text, Text]]: ...
class SSLConnection(Connection):
description_format: Any
@@ -144,7 +144,7 @@ class UnixDomainSocketConnection(Connection):
health_check_interval: int = ...,
client_name=...,
) -> None: ...
def repr_pieces(self) -> list[Tuple[Text, Text]]: ...
def repr_pieces(self) -> list[tuple[Text, Text]]: ...
def to_bool(value: object) -> bool: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Container, Mapping, Text, Tuple
from typing import Any, Container, Mapping, Text
from . import cookies, exceptions, models, structures, utils
from .packages.urllib3 import exceptions as urllib3_exceptions, poolmanager, response
@@ -40,7 +40,7 @@ class BaseAdapter:
self,
request: PreparedRequest,
stream: bool = ...,
timeout: None | float | Tuple[float, float] | Tuple[float, None] = ...,
timeout: None | float | tuple[float, float] | tuple[float, None] = ...,
verify: bool | str = ...,
cert: None | bytes | Text | Container[bytes | Text] = ...,
proxies: Mapping[str, str] | None = ...,
@@ -69,7 +69,7 @@ class HTTPAdapter(BaseAdapter):
self,
request: PreparedRequest,
stream: bool = ...,
timeout: None | float | Tuple[float, float] | Tuple[float, None] = ...,
timeout: None | float | tuple[float, float] | tuple[float, None] = ...,
verify: bool | str = ...,
cert: None | bytes | Text | Container[bytes | Text] = ...,
proxies: Mapping[str, str] | None = ...,

View File

@@ -63,13 +63,13 @@ _SessionT = TypeVar("_SessionT", bound=Session)
class Session(SessionRedirectMixin):
__attrs__: Any
headers: CaseInsensitiveDict[Text]
auth: None | Tuple[Text, Text] | _auth.AuthBase | Callable[[PreparedRequest], PreparedRequest]
auth: None | tuple[Text, Text] | _auth.AuthBase | Callable[[PreparedRequest], PreparedRequest]
proxies: _TextMapping
hooks: _Hooks
params: _Params
stream: bool
verify: None | bool | Text
cert: None | Text | Tuple[Text, Text]
cert: None | Text | tuple[Text, Text]
max_redirects: int
trust_env: bool
cookies: RequestsCookieJar
@@ -88,18 +88,18 @@ class Session(SessionRedirectMixin):
headers: _TextMapping | None = ...,
cookies: None | RequestsCookieJar | _TextMapping = ...,
files: MutableMapping[Text, IO[Any]]
| MutableMapping[Text, Tuple[Text, IO[Any]]]
| MutableMapping[Text, Tuple[Text, IO[Any], Text]]
| MutableMapping[Text, Tuple[Text, IO[Any], Text, _TextMapping]]
| MutableMapping[Text, tuple[Text, IO[Any]]]
| MutableMapping[Text, tuple[Text, IO[Any], Text]]
| MutableMapping[Text, tuple[Text, IO[Any], Text, _TextMapping]]
| None = ...,
auth: None | Tuple[Text, Text] | _auth.AuthBase | Callable[[PreparedRequest], PreparedRequest] = ...,
timeout: None | float | Tuple[float, float] | Tuple[float, None] = ...,
auth: None | tuple[Text, Text] | _auth.AuthBase | Callable[[PreparedRequest], PreparedRequest] = ...,
timeout: None | float | tuple[float, float] | tuple[float, None] = ...,
allow_redirects: bool | None = ...,
proxies: _TextMapping | None = ...,
hooks: _HooksInput | None = ...,
stream: bool | None = ...,
verify: None | bool | Text = ...,
cert: Text | Tuple[Text, Text] | None = ...,
cert: Text | tuple[Text, Text] | None = ...,
json: Any | None = ...,
) -> Response: ...
def get(

View File

@@ -1,10 +1,10 @@
from typing import Any, Dict, Generic, Iterable, Iterator, Mapping, MutableMapping, Tuple, TypeVar
from typing import Any, Dict, Generic, Iterable, Iterator, Mapping, MutableMapping, TypeVar
_VT = TypeVar("_VT")
class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]):
def __init__(self, data: Mapping[str, _VT] | Iterable[Tuple[str, _VT]] | None = ..., **kwargs: _VT) -> None: ...
def lower_items(self) -> Iterator[Tuple[str, _VT]]: ...
def __init__(self, data: Mapping[str, _VT] | Iterable[tuple[str, _VT]] | None = ..., **kwargs: _VT) -> None: ...
def lower_items(self) -> Iterator[tuple[str, _VT]]: ...
def __setitem__(self, key: str, value: _VT) -> None: ...
def __getitem__(self, key: str) -> _VT: ...
def __delitem__(self, key: str) -> None: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, AnyStr, Iterable, Mapping, Text, Tuple
from typing import Any, AnyStr, Iterable, Mapping, Text
from . import compat, cookies, exceptions, structures
@@ -51,4 +51,4 @@ def get_auth_from_url(url): ...
def to_native_string(string, encoding=...): ...
def urldefragauth(url): ...
def rewind_body(prepared_request): ...
def check_header_validity(header: Tuple[AnyStr, AnyStr]) -> None: ...
def check_header_validity(header: tuple[AnyStr, AnyStr]) -> None: ...

View File

@@ -13,7 +13,7 @@ def retry_call(
delay: float = ...,
max_delay: float | None = ...,
backoff: float = ...,
jitter: Tuple[float, float] | float = ...,
jitter: tuple[float, float] | float = ...,
logger: Logger | None = ...,
) -> _R: ...
def retry(
@@ -22,6 +22,6 @@ def retry(
delay: float = ...,
max_delay: float | None = ...,
backoff: float = ...,
jitter: Tuple[float, float] | float = ...,
jitter: tuple[float, float] | float = ...,
logger: Logger | None = ...,
) -> IdentityFunction: ...

View File

@@ -36,7 +36,7 @@ class WorkingSet:
def subscribe(self, callback: Callable[[Distribution], None]) -> None: ...
def find_plugins(
self, plugin_env: Environment, full_env: Environment | None = ..., fallback: bool = ...
) -> Tuple[list[Distribution], dict[Distribution, Exception]]: ...
) -> tuple[list[Distribution], dict[Distribution, Exception]]: ...
working_set: WorkingSet = ...
@@ -71,7 +71,7 @@ class Requirement:
project_name: str
key: str
extras: Tuple[str, ...]
specs: list[Tuple[str, str]]
specs: list[tuple[str, str]]
# TODO: change this to packaging.markers.Marker | None once we can import
# packaging.markers
marker: Any | None
@@ -255,7 +255,7 @@ class FileMetadata(EmptyProvider, IResourceProvider):
def parse_version(v: str) -> Version | LegacyVersion: ...
def yield_lines(strs: _NestedStr) -> Generator[str, None, None]: ...
def split_sections(strs: _NestedStr) -> Generator[Tuple[str | None, str], None, None]: ...
def split_sections(strs: _NestedStr) -> Generator[tuple[str | None, str], None, None]: ...
def safe_name(name: str) -> str: ...
def safe_version(version: str) -> str: ...
def safe_extra(extra: str) -> str: ...

View File

@@ -1,5 +1,5 @@
from socket import socket
from typing import Any, FrozenSet, Iterable, Sequence, Set, Tuple
from typing import Any, FrozenSet, Iterable, Sequence, Set
from .compat import HAS_IPV6 as HAS_IPV6, PY2 as PY2, WIN as WIN, string_types as string_types
from .proxy_headers import PROXY_HEADERS as PROXY_HEADERS
@@ -48,7 +48,7 @@ class Adjustments:
expose_tracebacks: bool = ...
unix_socket: str | None = ...
unix_socket_perms: int = ...
socket_options: list[Tuple[int, int, int]] = ...
socket_options: list[tuple[int, int, int]] = ...
asyncore_loop_timeout: int = ...
asyncore_use_poll: bool = ...
ipv4: bool = ...
@@ -56,6 +56,6 @@ class Adjustments:
sockets: list[socket] = ...
def __init__(self, **kw: Any) -> None: ...
@classmethod
def parse_args(cls, argv: str) -> Tuple[dict[str, Any], Any]: ...
def parse_args(cls, argv: str) -> tuple[dict[str, Any], Any]: ...
@classmethod
def check_sockets(cls, sockets: Iterable[socket]) -> None: ...

View File

@@ -1,6 +1,6 @@
from socket import socket
from threading import Condition, Lock
from typing import Mapping, Sequence, Tuple
from typing import Mapping, Sequence
from waitress.adjustments import Adjustments
from waitress.buffers import OverflowableBuffer
@@ -31,7 +31,7 @@ class HTTPChannel(wasyncore.dispatcher):
sendbuf_len: int = ...
task_lock: Lock = ...
outbuf_lock: Condition = ...
addr: Tuple[str, int] = ...
addr: tuple[str, int] = ...
def __init__(
self, server: BaseWSGIServer, sock: socket, addr: str, adj: Adjustments, map: Mapping[int, socket] | None = ...
) -> None: ...

View File

@@ -1,12 +1,12 @@
from io import TextIOWrapper
from typing import Any, Tuple
from typing import Any
PY2: bool
PY3: bool
WIN: bool
string_types: Tuple[str]
integer_types: Tuple[int]
class_types: Tuple[type]
string_types: tuple[str]
integer_types: tuple[int]
class_types: tuple[type]
text_type = str
binary_type = bytes
long = int

View File

@@ -1,5 +1,5 @@
from io import BytesIO
from typing import Any, Mapping, Pattern, Sequence, Tuple
from typing import Any, Mapping, Pattern, Sequence
from waitress.adjustments import Adjustments
from waitress.receiver import ChunkedReceiver, FixedStreamReceiver
@@ -35,9 +35,9 @@ class HTTPRequestParser:
def get_body_stream(self) -> BytesIO: ...
def close(self) -> None: ...
def split_uri(uri: bytes) -> Tuple[str, str, bytes, str, str]: ...
def split_uri(uri: bytes) -> tuple[str, str, bytes, str, str]: ...
def get_header_lines(header: bytes) -> Sequence[bytes]: ...
first_line_re: Pattern[Any]
def crack_first_line(line: str) -> Tuple[bytes, bytes, bytes]: ...
def crack_first_line(line: str) -> tuple[bytes, bytes, bytes]: ...

View File

@@ -1,10 +1,10 @@
from io import TextIOWrapper
from typing import Any, Callable, Pattern, Sequence, Tuple
from typing import Any, Callable, Pattern, Sequence
HELP: str
RUNNER_PATTERN: Pattern[Any]
def match(obj_name: str) -> Tuple[str, str]: ...
def match(obj_name: str) -> tuple[str, str]: ...
def resolve(module_name: str, object_name: str) -> Any: ...
def show_help(stream: TextIOWrapper, name: str, error: str | None = ...) -> None: ...
def show_exception(stream: TextIOWrapper) -> None: ...

View File

@@ -1,5 +1,5 @@
from socket import socket
from typing import Any, Sequence, Tuple
from typing import Any, Sequence
from waitress.adjustments import Adjustments
from waitress.channel import HTTPChannel
@@ -20,13 +20,13 @@ class MultiSocketServer:
asyncore: Any = ...
adj: Adjustments = ...
map: Any = ...
effective_listen: Sequence[Tuple[str, int]] = ...
effective_listen: Sequence[tuple[str, int]] = ...
task_dispatcher: ThreadedTaskDispatcher = ...
def __init__(
self,
map: Any | None = ...,
adj: Adjustments | None = ...,
effective_listen: Sequence[Tuple[str, int]] | None = ...,
effective_listen: Sequence[tuple[str, int]] | None = ...,
dispatcher: ThreadedTaskDispatcher | None = ...,
) -> None: ...
def print_listen(self, format_str: str) -> None: ...
@@ -38,7 +38,7 @@ class BaseWSGIServer(wasyncore.dispatcher):
next_channel_cleanup: int = ...
socketmod: socket = ...
asyncore: Any = ...
sockinfo: Tuple[int, int, int, Tuple[str, int]] = ...
sockinfo: tuple[int, int, int, tuple[str, int]] = ...
family: int = ...
socktype: int = ...
application: Any = ...
@@ -80,7 +80,7 @@ class BaseWSGIServer(wasyncore.dispatcher):
class TcpWSGIServer(BaseWSGIServer):
def bind_server_socket(self) -> None: ...
def getsockname(self) -> Tuple[str, Tuple[str, int]]: ...
def getsockname(self) -> tuple[str, tuple[str, int]]: ...
def set_socket_options(self, conn: socket) -> None: ...
class UnixWSGIServer(BaseWSGIServer):
@@ -96,8 +96,8 @@ class UnixWSGIServer(BaseWSGIServer):
**kw: Any,
) -> None: ...
def bind_server_socket(self) -> None: ...
def getsockname(self) -> Tuple[str, Tuple[str, int]]: ...
def fix_addr(self, addr: Any) -> Tuple[str, None]: ...
def getsockname(self) -> tuple[str, tuple[str, int]]: ...
def fix_addr(self, addr: Any) -> tuple[str, None]: ...
def get_server_name(self, ip: Any) -> str: ...
WSGIServer: TcpWSGIServer

View File

@@ -1,6 +1,6 @@
from logging import Logger
from threading import Condition, Lock
from typing import Any, Deque, Mapping, Sequence, Tuple
from typing import Any, Deque, Mapping, Sequence
from .channel import HTTPChannel
from .utilities import Error
@@ -39,7 +39,7 @@ class Task:
logger: Logger = ...
channel: HTTPChannel = ...
request: Error = ...
response_headers: Sequence[Tuple[str, str]] = ...
response_headers: Sequence[tuple[str, str]] = ...
version: str = ...
def __init__(self, channel: HTTPChannel, request: Error) -> None: ...
def service(self) -> None: ...
@@ -60,7 +60,7 @@ class ErrorTask(Task):
class WSGITask(Task):
environ: Any | None = ...
response_headers: Sequence[Tuple[str, str]] = ...
response_headers: Sequence[tuple[str, str]] = ...
complete: bool = ...
status: str = ...
content_length: int = ...

View File

@@ -1,5 +1,5 @@
from logging import Logger
from typing import Any, Callable, Mapping, Match, Pattern, Sequence, Tuple
from typing import Any, Callable, Mapping, Match, Pattern, Sequence
from .rfc7230 import OBS_TEXT as OBS_TEXT, VCHAR as VCHAR
@@ -23,12 +23,12 @@ months_reg: str
rfc822_date: str
rfc822_reg: Pattern[Any]
def unpack_rfc822(m: Match[Any]) -> Tuple[int, int, int, int, int, int, int, int, int]: ...
def unpack_rfc822(m: Match[Any]) -> tuple[int, int, int, int, int, int, int, int, int]: ...
rfc850_date: str
rfc850_reg: Pattern[Any]
def unpack_rfc850(m: Match[Any]) -> Tuple[int, int, int, int, int, int, int, int, int]: ...
def unpack_rfc850(m: Match[Any]) -> tuple[int, int, int, int, int, int, int, int, int]: ...
weekdayname: Sequence[str]
monthname: Sequence[str]
@@ -52,8 +52,8 @@ class Error:
reason: str = ...
body: str = ...
def __init__(self, body: str) -> None: ...
def to_response(self) -> Tuple[str, Sequence[Tuple[str, str]], str]: ...
def wsgi_response(self, environ: Any, start_response: Callable[[str, Sequence[Tuple[str, str]]], None]) -> str: ...
def to_response(self) -> tuple[str, Sequence[tuple[str, str]], str]: ...
def wsgi_response(self, environ: Any, start_response: Callable[[str, Sequence[tuple[str, str]]], None]) -> str: ...
class BadRequest(Error):
code: int = ...

View File

@@ -1,7 +1,7 @@
from io import BytesIO
from logging import Logger
from socket import socket
from typing import Any, Callable, Mapping, Tuple
from typing import Any, Callable, Mapping
from . import compat as compat, utilities as utilities
@@ -21,7 +21,7 @@ def poll2(timeout: float = ..., map: Mapping[int, socket] | None = ...) -> None:
poll3 = poll2
def loop(timeout: float = ..., use_poll: bool = ..., map: Mapping[int, socket] | None = ..., count: int | None = ...) -> None: ...
def compact_traceback() -> Tuple[Tuple[str, str, str], BaseException, BaseException, str]: ...
def compact_traceback() -> tuple[tuple[str, str, str], BaseException, BaseException, str]: ...
class dispatcher:
debug: bool = ...
@@ -29,24 +29,24 @@ class dispatcher:
accepting: bool = ...
connecting: bool = ...
closing: bool = ...
addr: Tuple[str, int] | None = ...
addr: tuple[str, int] | None = ...
ignore_log_types: frozenset[Any]
logger: Logger = ...
compact_traceback: Callable[[], Tuple[Tuple[str, str, str], BaseException, BaseException, str]] = ...
compact_traceback: Callable[[], tuple[tuple[str, str, str], BaseException, BaseException, str]] = ...
socket: _socket | None = ...
def __init__(self, sock: _socket | None = ..., map: Mapping[int, _socket] | None = ...) -> None: ...
def add_channel(self, map: Mapping[int, _socket] | None = ...) -> None: ...
def del_channel(self, map: Mapping[int, _socket] | None = ...) -> None: ...
family_and_type: Tuple[int, int] = ...
family_and_type: tuple[int, int] = ...
def create_socket(self, family: int = ..., type: int = ...) -> None: ...
def set_socket(self, sock: _socket, map: Mapping[int, _socket] | None = ...) -> None: ...
def set_reuse_addr(self) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def listen(self, num: int) -> None: ...
def bind(self, addr: Tuple[str, int]) -> None: ...
def connect(self, address: Tuple[str, int]) -> None: ...
def accept(self) -> Tuple[_socket, Tuple[str, int]] | None: ...
def bind(self, addr: tuple[str, int]) -> None: ...
def connect(self, address: tuple[str, int]) -> None: ...
def accept(self) -> tuple[_socket, tuple[str, int]] | None: ...
def send(self, data: bytes) -> int: ...
def recv(self, buffer_size: int) -> bytes: ...
def close(self) -> None: ...