From 33d1c1f0cc2c2b8be1935aedf5cf45173128e988 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 25 Jul 2022 11:52:24 +0300 Subject: [PATCH 1/3] Type `http.client.HTTPConnection.sock` --- stdlib/http/client.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 949ac9289fa5..063e7d7c5a74 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 | None def __init__( self, host: str, From 0fb63e6c432ff6ce475bce39e3b5901f8bbae2ca Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 25 Jul 2022 12:48:38 +0300 Subject: [PATCH 2/3] Update client.pyi --- stdlib/http/client.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 063e7d7c5a74..bb59de903afe 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: socket | None + sock: socket | Any # can be `None` if `.connect()` was not called def __init__( self, host: str, From fb57e47ff34a1a12124483c368534c750867ef71 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 26 Jul 2022 10:05:17 +0300 Subject: [PATCH 3/3] Update client.pyi --- stdlib/http/client.pyi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index bb59de903afe..2c75e7b37c2e 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -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,