mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 03:41:28 +08:00
committed by
Jelle Zijlstra
parent
8794e40d41
commit
0177dedc42
@@ -138,32 +138,33 @@ else:
|
||||
|
||||
# This is an API stub only for the class below, not a class itself.
|
||||
# urllib.request uses it for a parameter.
|
||||
class HTTPConnectionProtocol(Protocol):
|
||||
class _HTTPConnectionProtocol(Protocol):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __call__(self, host: str, port: Optional[int] = ...,
|
||||
timeout: int = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
blocksize: int = ...): ...
|
||||
else:
|
||||
def __call__(self, host: str, port: Optional[int] = ...,
|
||||
timeout: int = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...): ...
|
||||
|
||||
class HTTPConnection:
|
||||
host: str = ...
|
||||
port: int = ...
|
||||
timeout: float
|
||||
host: str
|
||||
port: int
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(
|
||||
self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
timeout: int = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
timeout: int = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...
|
||||
) -> None: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
@@ -196,7 +197,7 @@ class HTTPSConnection(HTTPConnection):
|
||||
host: str, port: Optional[int] = ...,
|
||||
key_file: Optional[str] = ...,
|
||||
cert_file: Optional[str] = ...,
|
||||
timeout: int = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
*, context: Optional[ssl.SSLContext] = ...,
|
||||
check_hostname: Optional[bool] = ...) -> None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import (
|
||||
Any, Callable, ClassVar, Dict, List, IO, Mapping, Optional, Sequence, Tuple,
|
||||
TypeVar, Union, overload, NoReturn,
|
||||
)
|
||||
from http.client import HTTPResponse, HTTPMessage, HTTPConnectionProtocol
|
||||
from http.client import HTTPResponse, HTTPMessage, _HTTPConnectionProtocol
|
||||
from http.cookiejar import CookieJar
|
||||
from email.message import Message
|
||||
from urllib.response import addinfourl
|
||||
@@ -162,7 +162,7 @@ class AbstractHTTPHandler(BaseHandler): # undocumented
|
||||
def set_http_debuglevel(self, level: int) -> None: ...
|
||||
def do_request_(self, request: Request) -> Request: ...
|
||||
def do_open(self,
|
||||
http_class: HTTPConnectionProtocol,
|
||||
http_class: _HTTPConnectionProtocol,
|
||||
req: Request,
|
||||
**http_conn_args: Any) -> HTTPResponse: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user