diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 949ac9289fa5..2c75e7b37c2e 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -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,