mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-22 19:13:34 +08:00
Add assorted annotations (#3335)
* Add assorted annotations * Fix type of Purpose items
This commit is contained in:
committed by
Jelle Zijlstra
parent
8a7d61741d
commit
d41bcd39e1
@@ -181,8 +181,8 @@ if sys.version_info < (3,):
|
||||
else:
|
||||
class _ASN1Object(NamedTuple('_ASN1Object', [('nid', int), ('shortname', str), ('longname', str), ('oid', str)])): ...
|
||||
class Purpose(_ASN1Object, enum.Enum):
|
||||
SERVER_AUTH = ...
|
||||
CLIENT_AUTH = ...
|
||||
SERVER_AUTH: _ASN1Object
|
||||
CLIENT_AUTH: _ASN1Object
|
||||
|
||||
class SSLSocket(socket.socket):
|
||||
context: SSLContext
|
||||
@@ -208,17 +208,15 @@ class SSLSocket(socket.socket):
|
||||
def version(self) -> Optional[str]: ...
|
||||
def pending(self) -> int: ...
|
||||
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
class TLSVersion(enum.IntEnum):
|
||||
MINIMUM_SUPPORTED = ...
|
||||
MAXIMUM_SUPPORTED = ...
|
||||
SSLv3 = ...
|
||||
TLSv1 = ...
|
||||
TLSv1_1 = ...
|
||||
TLSv1_2 = ...
|
||||
TLSv1_3 = ...
|
||||
|
||||
MINIMUM_SUPPORTED: int
|
||||
MAXIMUM_SUPPORTED: int
|
||||
SSLv3: int
|
||||
TLSv1: int
|
||||
TLSv1_1: int
|
||||
TLSv1_2: int
|
||||
TLSv1_3: int
|
||||
|
||||
class SSLContext:
|
||||
check_hostname: bool
|
||||
|
||||
@@ -112,14 +112,18 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
# urllib.request uses it for a parameter.
|
||||
class _HTTPConnectionProtocol(Protocol):
|
||||
if sys.version_info >= (3, 7):
|
||||
def __call__(self, host: str, port: Optional[int] = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
blocksize: int = ...): ...
|
||||
def __call__(
|
||||
self,
|
||||
host: str,
|
||||
port: Optional[int] = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
blocksize: int = ...,
|
||||
) -> HTTPConnection: ...
|
||||
else:
|
||||
def __call__(self, host: str, port: Optional[int] = ...,
|
||||
timeout: float = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...): ...
|
||||
def __call__(
|
||||
self, host: str, port: Optional[int] = ..., timeout: float = ..., source_address: Optional[Tuple[str, int]] = ...,
|
||||
) -> HTTPConnection: ...
|
||||
|
||||
class HTTPConnection:
|
||||
timeout: float
|
||||
|
||||
Reference in New Issue
Block a user