Add missing definitions for urllib/response.pyi (#4118)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Teddy SudolandJelle Zijlstra authored and GitHub committed 2020-05-28 13:48:27 +02:00
1 parent 0cffa59e57
commit 313a835bea
2 files changed
+10 -3

No files matched your search

+10 -1
View File
@@ -1,12 +1,14 @@
# private module, we only expose what's needed
from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar
from typing import Any, BinaryIO, Callable, IO, Iterable, List, Mapping, Optional, Tuple, Type, TypeVar
from email.message import Message
from types import TracebackType
_AIUT = TypeVar("_AIUT", bound=addbase)
class addbase(BinaryIO):
fp: IO[bytes]
def __init__(self, fp: IO[bytes]) -> None: ...
def __enter__(self: _AIUT) -> _AIUT: ...
def __exit__(self, type: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[TracebackType]) -> None: ...
def __iter__(self: _AIUT) -> _AIUT: ...
@@ -31,12 +33,19 @@ class addbase(BinaryIO):
def write(self, s: bytes) -> int: ...
def writelines(self, lines: Iterable[bytes]) -> None: ...
class addclosehook(addbase):
closehook: Callable[..., object]
hookargs: Tuple[Any, ...]
def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ...
class addinfo(addbase):
headers: Message
def __init__(self, fp: IO[bytes], headers: Message) -> None: ...
def info(self) -> Message: ...
class addinfourl(addinfo):
url: str
code: int
def __init__(self, fp: IO[bytes], headers: Message, url: str, code: Optional[int] = ...) -> None: ...
def geturl(self) -> str: ...
def getcode(self) -> int: ...