Add assorted annotations (#3335)

* Add assorted annotations

* Fix type of Purpose items
This commit is contained in:
Sebastian Rittau
2019-10-11 05:51:49 +02:00
committed by Jelle Zijlstra
parent 8a7d61741d
commit d41bcd39e1
2 changed files with 20 additions and 18 deletions

View File

@@ -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