Skip to content

Commit c5fc0a8

Browse files
authored
Fix type hints in HTTPAdapter stub, add comments for Any
1 parent a6b1d9b commit c5fc0a8

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

stubs/requests/requests/adapters.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ class HTTPAdapter(BaseAdapter):
9191
# ssl_context (ssl.SSLContext), socket_options (list), etc.
9292
# We use Any because the exact set is dynamic and not fully specified in stubs.
9393
) -> None: ...
94-
def proxy_manager_for(
95-
self,
96-
proxy: str,
97-
**proxy_kwargs: Any # Any: Same as pool_kwargs above, passed to ProxyManager or SOCKSProxyManager.
98-
# May include: ssl_context, cert_reqs, ca_certs, ca_cert_dir, etc.
99-
) -> Any: # Any: Returns either urllib3.ProxyManager (for HTTP/HTTPS proxies) or SOCKSProxyManager (for SOCKS).
100-
# The exact return type depends on the proxy scheme and is not needed by callers; using Any avoids
101-
# circular imports or complex union types. In practice, the object adheres to a common interface.
102-
...
94+
def proxy_manager_for(
95+
self,
96+
proxy: str,
97+
**proxy_kwargs: Any # Any: Same as pool_kwargs above, passed to ProxyManager or SOCKSProxyManager.
98+
# May include: ssl_context, cert_reqs, ca_certs, ca_cert_dir, etc.
99+
) -> Any: # Any: Returns either urllib3.ProxyManager (for HTTP/HTTPS proxies) or SOCKSProxyManager (for SOCKS).
100+
# The exact return type depends on the proxy scheme and is not needed by callers; using Any avoids
101+
# circular imports or complex union types. In practice, the object adheres to a common interface.
102+
...
103103
def cert_verify(self, conn, url, verify, cert): ...
104104
def build_response(self, req: PreparedRequest, resp: urllib3.BaseHTTPResponse) -> Response: ...
105105
def build_connection_pool_key_attributes(
@@ -124,7 +124,7 @@ class HTTPAdapter(BaseAdapter):
124124
# verify (bool|str), cert (str|tuple), proxies (dict). Base implementation ignores them.
125125
# Using Any allows subclasses to access these arguments without repeating the full signature.
126126
) -> None: ...
127-
def proxy_headers(self, proxy: str) -> dict[str, str]: ...
127+
def proxy_headers(self, proxy: str) -> dict[str, str]: ...
128128
def send(
129129
self,
130130
request: PreparedRequest,

0 commit comments

Comments
 (0)