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

@@ -5,7 +5,7 @@ import sys
import types
from _typeshed import Self, WriteableBuffer
from socket import socket
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Tuple, Type, TypeVar, Union, overload
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, Type, TypeVar, Union, overload
_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
_T = TypeVar("_T")
@@ -96,7 +96,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
def getheader(self, name: str) -> str | None: ...
@overload
def getheader(self, name: str, default: _T) -> str | _T: ...
def getheaders(self) -> list[Tuple[str, str]]: ...
def getheaders(self) -> list[tuple[str, str]]: ...
def fileno(self) -> int: ...
def isclosed(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...
@@ -118,12 +118,12 @@ class _HTTPConnectionProtocol(Protocol):
host: str,
port: int | None = ...,
timeout: float = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> HTTPConnection: ...
else:
def __call__(
self, host: str, port: int | None = ..., timeout: float = ..., source_address: Tuple[str, int] | None = ...
self, host: str, port: int | None = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
) -> HTTPConnection: ...
class HTTPConnection:
@@ -141,12 +141,12 @@ class HTTPConnection:
host: str,
port: int | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> None: ...
else:
def __init__(
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: Tuple[str, int] | None = ...
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
) -> None: ...
def request(
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
@@ -170,7 +170,7 @@ class HTTPSConnection(HTTPConnection):
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
@@ -184,7 +184,7 @@ class HTTPSConnection(HTTPConnection):
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: Tuple[str, int] | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,