From abd893abaed9a15affd33fe846211dc3c3adcd03 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 26 Jul 2022 12:07:54 +0300 Subject: [PATCH] Type `http.client.HTTPConnection.sock` (#8386) --- stdlib/http/client.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 949ac9289..2c75e7b37 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,