Type http.client.HTTPConnection.sock (#8386)

This commit is contained in:
Nikita Sobolev
2022-07-26 12:07:54 +03:00
committed by GitHub
parent df905102da
commit abd893abae

View File

@@ -157,7 +157,7 @@ class HTTPConnection:
timeout: float | None
host: str
port: int
sock: Any
sock: socket | Any # can be `None` if `.connect()` was not called
def __init__(
self,
host: str,
@@ -180,6 +180,8 @@ class HTTPConnection:
def send(self, data: _DataType) -> None: ...
class HTTPSConnection(HTTPConnection):
# Can be `None` if `.connect()` was not called:
sock: ssl.SSLSocket | Any # type: ignore[override]
def __init__(
self,
host: str,