Skip to content

Commit abd893a

Browse files
authored
Type http.client.HTTPConnection.sock (#8386)
1 parent df90510 commit abd893a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/http/client.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class HTTPConnection:
157157
timeout: float | None
158158
host: str
159159
port: int
160-
sock: Any
160+
sock: socket | Any # can be `None` if `.connect()` was not called
161161
def __init__(
162162
self,
163163
host: str,
@@ -180,6 +180,8 @@ class HTTPConnection:
180180
def send(self, data: _DataType) -> None: ...
181181

182182
class HTTPSConnection(HTTPConnection):
183+
# Can be `None` if `.connect()` was not called:
184+
sock: ssl.SSLSocket | Any # type: ignore[override]
183185
def __init__(
184186
self,
185187
host: str,

0 commit comments

Comments
 (0)