Add missing type hints in http.client (#5734)

* Add missing type hints in http.client

* Add http.client.HTTPConnection.response_class to exclude list
This commit is contained in:
Anton Grübel
2021-07-08 13:43:42 +02:00
committed by GitHub
parent 9d5046ee7f
commit 0085539df3
2 changed files with 8 additions and 1 deletions

View File

@@ -90,7 +90,8 @@ NETWORK_AUTHENTICATION_REQUIRED: int
responses: Dict[int, str]
class HTTPMessage(email.message.Message): ...
class HTTPMessage(email.message.Message):
def getallmatchingheaders(self, name: str) -> list[str]: ... # undocumented
def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ...
@@ -103,6 +104,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
status: int
reason: str
def __init__(self, sock: socket, debuglevel: int = ..., method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
def peek(self, n: int = ...) -> bytes: ...
def read(self, amt: Optional[int] = ...) -> bytes: ...
def read1(self, n: int = ...) -> bytes: ...
def readinto(self, b: WriteableBuffer) -> int: ...
@@ -142,6 +144,10 @@ class _HTTPConnectionProtocol(Protocol):
) -> HTTPConnection: ...
class HTTPConnection:
auto_open: int = ... # undocumented
debuglevel: int = ...
default_port: int = ... # undocumented
response_class: Type[HTTPResponse] = ... # undocumented
timeout: Optional[float]
host: str
port: int

View File

@@ -88,6 +88,7 @@ enum.EnumMeta.__call__
enum.EnumMeta.__new__
http.HTTPStatus.description # set in __new__
http.HTTPStatus.phrase # set in __new__
http.client.HTTPConnection.response_class # the actual type at runtime is abc.ABCMeta
imaplib.IMAP4_SSL.ssl # Dependent on SSL existence
importlib.abc.FileLoader.get_filename # Wrapped with _check_name decorator which changes runtime signature
importlib.abc.FileLoader.load_module # Wrapped with _check_name decorator which changes runtime signature