mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-19 01:22:51 +08:00
Flake8 fixes (#2549)
* Fix over-indented continuation lines * Fix under-indented continuation lines * Fix whitespace around default operator problems * Limit line lengths * Fix inconsistent files
This commit is contained in:
committed by
Jelle Zijlstra
parent
f362cf47fa
commit
006a79220f
@@ -55,14 +55,14 @@ class staticmethod(object): # Special, only valid as a decorator.
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class classmethod(object): # Special, only valid as a decorator.
|
||||
__func__ = ... # type: function
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class type(object):
|
||||
__bases__ = ... # type: Tuple[type, ...]
|
||||
@@ -871,8 +871,7 @@ def open(file: unicode, mode: unicode = ..., buffering: int = ...) -> BinaryIO:
|
||||
def open(file: int, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...
|
||||
def ord(c: unicode) -> int: ...
|
||||
# This is only available after from __future__ import print_function.
|
||||
def print(*values: Any, sep: unicode = ..., end: unicode = ...,
|
||||
file: IO[Any] = ...) -> None: ...
|
||||
def print(*values: Any, sep: unicode = ..., end: unicode = ..., file: IO[Any] = ...) -> None: ...
|
||||
@overload
|
||||
def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y.
|
||||
@overload
|
||||
@@ -925,12 +924,10 @@ def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ...
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2,
|
||||
_T3, _T4, _T5]]: ...
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
|
||||
iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
|
||||
|
||||
@@ -275,7 +275,7 @@ class SocketType(object):
|
||||
raise error
|
||||
def recvfrom_into(self, buffer: bytearray, nbytes: int = ...,
|
||||
flags: int = ...) -> int: ...
|
||||
def send(self, data: str, flags: int =...) -> int: ...
|
||||
def send(self, data: str, flags: int = ...) -> int: ...
|
||||
def sendall(self, data: str, flags: int = ...) -> None: ...
|
||||
@overload
|
||||
def sendto(self, data: str, address: tuple) -> int: ...
|
||||
|
||||
@@ -55,14 +55,14 @@ class staticmethod(object): # Special, only valid as a decorator.
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class classmethod(object): # Special, only valid as a decorator.
|
||||
__func__ = ... # type: function
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class type(object):
|
||||
__bases__ = ... # type: Tuple[type, ...]
|
||||
@@ -871,8 +871,7 @@ def open(file: unicode, mode: unicode = ..., buffering: int = ...) -> BinaryIO:
|
||||
def open(file: int, mode: unicode = ..., buffering: int = ...) -> BinaryIO: ...
|
||||
def ord(c: unicode) -> int: ...
|
||||
# This is only available after from __future__ import print_function.
|
||||
def print(*values: Any, sep: unicode = ..., end: unicode = ...,
|
||||
file: IO[Any] = ...) -> None: ...
|
||||
def print(*values: Any, sep: unicode = ..., end: unicode = ..., file: IO[Any] = ...) -> None: ...
|
||||
@overload
|
||||
def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y.
|
||||
@overload
|
||||
@@ -925,12 +924,10 @@ def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ...
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2,
|
||||
_T3, _T4, _T5]]: ...
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
|
||||
iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
|
||||
|
||||
@@ -3,15 +3,10 @@ from typing import List, Tuple
|
||||
class GetoptError(Exception):
|
||||
opt = ... # type: str
|
||||
msg = ... # type: str
|
||||
def __init__(self, msg: str, opt: str=...) -> None: ...
|
||||
def __init__(self, msg: str, opt: str = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
error = GetoptError
|
||||
|
||||
def getopt(args: List[str], shortopts: str,
|
||||
longopts: List[str]=...) -> Tuple[List[Tuple[str, str]],
|
||||
List[str]]: ...
|
||||
|
||||
def gnu_getopt(args: List[str], shortopts: str,
|
||||
longopts: List[str]=...) -> Tuple[List[Tuple[str, str]],
|
||||
List[str]]: ...
|
||||
def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ...
|
||||
def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ...
|
||||
|
||||
@@ -28,7 +28,7 @@ class HTTPResponse:
|
||||
chunk_left = ... # type: Any
|
||||
length = ... # type: Any
|
||||
will_close = ... # type: Any
|
||||
def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering: bool=...) -> None: ...
|
||||
def __init__(self, sock, debuglevel=0, strict=0, method=None, buffering: bool = ...) -> None: ...
|
||||
def begin(self): ...
|
||||
def close(self): ...
|
||||
def isclosed(self): ...
|
||||
@@ -56,16 +56,16 @@ class HTTPConnection:
|
||||
def putheader(self, header, *values): ...
|
||||
def endheaders(self, message_body=None): ...
|
||||
def request(self, method, url, body=None, headers=...): ...
|
||||
def getresponse(self, buffering: bool=...): ...
|
||||
def getresponse(self, buffering: bool = ...): ...
|
||||
|
||||
class HTTP:
|
||||
debuglevel = ... # type: Any
|
||||
def __init__(self, host: str=..., port=None, strict=None) -> None: ...
|
||||
def __init__(self, host: str = ..., port=None, strict=None) -> None: ...
|
||||
def connect(self, host=None, port=None): ...
|
||||
def getfile(self): ...
|
||||
file = ... # type: Any
|
||||
headers = ... # type: Any
|
||||
def getreply(self, buffering: bool=...): ...
|
||||
def getreply(self, buffering: bool = ...): ...
|
||||
def close(self): ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
@@ -79,7 +79,7 @@ class HTTPSConnection(HTTPConnection):
|
||||
class HTTPS(HTTP):
|
||||
key_file = ... # type: Any
|
||||
cert_file = ... # type: Any
|
||||
def __init__(self, host: str=..., port=None, key_file=None, cert_file=None, strict=None, context=None) -> None: ...
|
||||
def __init__(self, host: str = ..., port=None, key_file=None, cert_file=None, strict=None, context=None) -> None: ...
|
||||
|
||||
class HTTPException(Exception): ...
|
||||
class NotConnected(HTTPException): ...
|
||||
|
||||
@@ -94,11 +94,11 @@ def getargs(co: CodeType) -> Arguments: ...
|
||||
def getargspec(func: object) -> ArgSpec: ...
|
||||
def getargvalues(frame: FrameType) -> ArgInfo: ...
|
||||
def formatargspec(args, varargs=..., varkw=..., defaults=...,
|
||||
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
|
||||
join=...) -> str: ...
|
||||
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
|
||||
join=...) -> str: ...
|
||||
def formatargvalues(args, varargs=..., varkw=..., defaults=...,
|
||||
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
|
||||
join=...) -> str: ...
|
||||
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
|
||||
join=...) -> str: ...
|
||||
def getmro(cls: type) -> Tuple[type, ...]: ...
|
||||
def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ...
|
||||
|
||||
|
||||
@@ -22,9 +22,9 @@ from _io import UnsupportedOperation as UnsupportedOperation
|
||||
from _io import open as open
|
||||
|
||||
def _OpenWrapper(file: Union[str, unicode, int],
|
||||
mode: unicode = ..., buffering: int = ..., encoding: unicode = ...,
|
||||
errors: unicode = ..., newline: unicode = ...,
|
||||
closefd: bool = ...) -> IO[Any]: ...
|
||||
mode: unicode = ..., buffering: int = ..., encoding: unicode = ...,
|
||||
errors: unicode = ..., newline: unicode = ...,
|
||||
closefd: bool = ...) -> IO[Any]: ...
|
||||
|
||||
SEEK_SET = ... # type: int
|
||||
SEEK_CUR = ... # type: int
|
||||
|
||||
@@ -54,8 +54,8 @@ _T6 = TypeVar('_T6')
|
||||
def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def imap(func: Callable[[_T1, _T2], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> Iterator[_S]: ...
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def imap(func: Callable[[_T1, _T2, _T3], _S],
|
||||
iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
|
||||
@@ -7,67 +7,63 @@ class JSONDecodeError(ValueError):
|
||||
def load(self, fp: IO[str]) -> Any: ...
|
||||
|
||||
def dumps(obj: Any,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
encoding: str = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> str: ...
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
encoding: str = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> str: ...
|
||||
|
||||
def dump(obj: Any,
|
||||
fp: Union[IO[str], IO[Text]],
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
encoding: str = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> None: ...
|
||||
fp: Union[IO[str], IO[Text]],
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Optional[int] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
encoding: str = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> None: ...
|
||||
|
||||
def loads(s: Union[Text, bytes],
|
||||
encoding: Any = ...,
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
encoding: Any = ...,
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
|
||||
def load(fp: IO[str],
|
||||
encoding: Optional[str] = ...,
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
encoding: Optional[str] = ...,
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
|
||||
class JSONDecoder(object):
|
||||
def __init__(self,
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
object_hook: Callable[..., Any] = ...,
|
||||
parse_float: Callable[[str], float] = ...,
|
||||
parse_int: Callable[[str], int] = ...,
|
||||
parse_constant: Callable[[str], Any] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Callable[..., Any] = ...) -> None: ...
|
||||
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
object_hook: Callable[..., Any] = ...,
|
||||
parse_float: Callable[[str], float] = ...,
|
||||
parse_int: Callable[[str], int] = ...,
|
||||
parse_constant: Callable[[str], Any] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Callable[..., Any] = ...) -> None: ...
|
||||
def decode(self, s: Union[Text, bytes], _w: Any = ...) -> Any: ...
|
||||
|
||||
def raw_decode(self,
|
||||
s: Union[Text, bytes],
|
||||
idx: int = ...) -> Tuple[Any, Any]: ...
|
||||
def raw_decode(self, s: Union[Text, bytes], idx: int = ...) -> Tuple[Any, Any]: ...
|
||||
|
||||
class JSONEncoder(object):
|
||||
item_separator = ... # type: str
|
||||
@@ -80,15 +76,15 @@ class JSONEncoder(object):
|
||||
indent = ... # type: int
|
||||
|
||||
def __init__(self,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: int = ...,
|
||||
separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ...,
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
default: Callable[..., Any] = ...) -> None: ...
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
sort_keys: bool = ...,
|
||||
indent: int = ...,
|
||||
separators: Tuple[Union[Text, bytes], Union[Text, bytes]] = ...,
|
||||
encoding: Union[Text, bytes] = ...,
|
||||
default: Callable[..., Any] = ...) -> None: ...
|
||||
|
||||
def default(self, o: Any) -> Any: ...
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ class Pool(ContextManager[Pool]):
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Dict[str, Any] = ...) -> Any: ...
|
||||
def apply_async(self,
|
||||
func: Callable[..., Any],
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Dict[str, Any] = ...,
|
||||
callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ...
|
||||
func: Callable[..., Any],
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Dict[str, Any] = ...,
|
||||
callback: Optional[Callable[..., None]] = ...) -> AsyncResult: ...
|
||||
def map(self,
|
||||
func: Callable[..., Any],
|
||||
iterable: Iterable[Any] = ...,
|
||||
|
||||
@@ -31,8 +31,7 @@ class Random(_random.Random):
|
||||
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ...,
|
||||
mode: float = ...) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ...
|
||||
def betavariate(self, alpha: float, beta: float) -> float: ...
|
||||
def expovariate(self, lambd: float) -> float: ...
|
||||
def gammavariate(self, alpha: float, beta: float) -> float: ...
|
||||
|
||||
@@ -36,30 +36,26 @@ class TextWrapper(object):
|
||||
def wrap(self, text: AnyStr) -> List[AnyStr]: ...
|
||||
def fill(self, text: AnyStr) -> AnyStr: ...
|
||||
|
||||
def wrap(
|
||||
text: AnyStr,
|
||||
width: int = ...,
|
||||
initial_indent: AnyStr = ...,
|
||||
subsequent_indent: AnyStr = ...,
|
||||
expand_tabs: bool = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
break_on_hyphens: bool = ...) -> List[AnyStr]:
|
||||
...
|
||||
def wrap(text: AnyStr,
|
||||
width: int = ...,
|
||||
initial_indent: AnyStr = ...,
|
||||
subsequent_indent: AnyStr = ...,
|
||||
expand_tabs: bool = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
break_on_hyphens: bool = ...) -> List[AnyStr]: ...
|
||||
|
||||
def fill(
|
||||
text: AnyStr,
|
||||
width: int =...,
|
||||
initial_indent: AnyStr = ...,
|
||||
subsequent_indent: AnyStr = ...,
|
||||
expand_tabs: bool = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
break_on_hyphens: bool = ...) -> AnyStr:
|
||||
...
|
||||
def fill(text: AnyStr,
|
||||
width: int = ...,
|
||||
initial_indent: AnyStr = ...,
|
||||
subsequent_indent: AnyStr = ...,
|
||||
expand_tabs: bool = ...,
|
||||
replace_whitespace: bool = ...,
|
||||
fix_sentence_endings: bool = ...,
|
||||
break_long_words: bool = ...,
|
||||
drop_whitespace: bool = ...,
|
||||
break_on_hyphens: bool = ...) -> AnyStr: ...
|
||||
|
||||
def dedent(text: AnyStr) -> AnyStr: ...
|
||||
|
||||
@@ -41,10 +41,8 @@ class TestResult:
|
||||
def stopTest(self, test: Testable) -> None: ...
|
||||
def startTestRun(self) -> None: ...
|
||||
def stopTestRun(self) -> None: ...
|
||||
def addError(self, test: Testable,
|
||||
err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addFailure(self, test: Testable,
|
||||
err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addError(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addFailure(self, test: Testable, err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addSuccess(self, test: Testable) -> None: ...
|
||||
def addSkip(self, test: Testable, reason: str) -> None: ...
|
||||
def addExpectedFailure(self, test: Testable, err: str) -> None: ...
|
||||
@@ -201,7 +199,7 @@ class TestLoader:
|
||||
def loadTestsFromName(self, name: str = ...,
|
||||
module: Optional[types.ModuleType] = ...) -> TestSuite: ...
|
||||
def loadTestsFromNames(self, names: List[str] = ...,
|
||||
module: Optional[types.ModuleType] = ...) -> TestSuite: ...
|
||||
module: Optional[types.ModuleType] = ...) -> TestSuite: ...
|
||||
def discover(self, start_dir: str, pattern: str = ...,
|
||||
top_level_dir: Optional[str] = ...) -> TestSuite: ...
|
||||
def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ...
|
||||
|
||||
@@ -31,8 +31,7 @@ if sys.version_info >= (3, 6):
|
||||
else:
|
||||
def b2a_base64(data: _Bytes) -> bytes: ...
|
||||
def a2b_qp(string: _Ascii, header: bool = ...) -> bytes: ...
|
||||
def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ...,
|
||||
header: bool = ...) -> bytes: ...
|
||||
def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ...
|
||||
def a2b_hqx(string: _Ascii) -> bytes: ...
|
||||
def rledecode_hqx(data: _Bytes) -> bytes: ...
|
||||
def rlecode_hqx(data: _Bytes) -> bytes: ...
|
||||
|
||||
@@ -51,7 +51,7 @@ def IS_CHARACTER_JUNK(line: _StrType) -> bool: ...
|
||||
def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ...,
|
||||
tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ...,
|
||||
n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ...
|
||||
def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType =...,
|
||||
def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ...,
|
||||
tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ...,
|
||||
n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ...
|
||||
def ndiff(a: Sequence[_StrType], b: Sequence[_StrType],
|
||||
|
||||
@@ -173,12 +173,12 @@ class Formatter:
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
def __init__(self, fmt: Optional[str] = ...,
|
||||
datefmt: Optional[str] =...,
|
||||
datefmt: Optional[str] = ...,
|
||||
style: str = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
fmt: Optional[str] = ...,
|
||||
datefmt: Optional[str] =...) -> None: ...
|
||||
datefmt: Optional[str] = ...) -> None: ...
|
||||
|
||||
def format(self, record: LogRecord) -> str: ...
|
||||
def formatTime(self, record: LogRecord, datefmt: str = ...) -> str: ...
|
||||
|
||||
@@ -129,7 +129,7 @@ class SysLogHandler(Handler):
|
||||
LOG_LOCAL6 = ... # type: int
|
||||
LOG_LOCAL7 = ... # type: int
|
||||
def __init__(self, address: Union[Tuple[str, int], str] = ...,
|
||||
facility: int = ..., socktype: _SocketKind = ...) -> None: ...
|
||||
facility: int = ..., socktype: _SocketKind = ...) -> None: ...
|
||||
def encodePriority(self, facility: Union[int, str],
|
||||
priority: Union[int, str]) -> int: ...
|
||||
def mapPriority(self, levelName: int) -> str: ...
|
||||
@@ -150,14 +150,14 @@ class SMTPHandler(Handler):
|
||||
def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str,
|
||||
toaddrs: List[str], subject: str,
|
||||
credentials: Optional[Tuple[str, str]] = ...,
|
||||
secure: Union[Tuple[str], Tuple[str, str], None] =...,
|
||||
secure: Union[Tuple[str], Tuple[str, str], None] = ...,
|
||||
timeout: float = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
mailhost: Union[str, Tuple[str, int]], fromaddr: str,
|
||||
toaddrs: List[str], subject: str,
|
||||
credentials: Optional[Tuple[str, str]] = ...,
|
||||
secure: Union[Tuple[str], Tuple[str, str], None] =...) -> None: ...
|
||||
secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ...
|
||||
def getSubject(self, record: LogRecord) -> str: ...
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class BufferingHandler(Handler):
|
||||
|
||||
class MemoryHandler(BufferingHandler):
|
||||
def __init__(self, capacity: int, flushLevel: int = ...,
|
||||
target: Optional[Handler] =...) -> None: ...
|
||||
target: Optional[Handler] = ...) -> None: ...
|
||||
def setTarget(self, target: Handler) -> None: ...
|
||||
|
||||
|
||||
|
||||
@@ -180,16 +180,17 @@ class OptionParser(OptionContainer):
|
||||
usage = ... # type: Optional[_Text]
|
||||
values = ... # type: Optional[Values]
|
||||
version = ... # type: _Text
|
||||
def __init__(self, usage: Optional[_Text] = ...,
|
||||
option_list: Iterable[Option] = ...,
|
||||
option_class: Option = ...,
|
||||
version: Optional[_Text] = ...,
|
||||
conflict_handler: _Text = ...,
|
||||
description: Optional[_Text] = ...,
|
||||
formatter: Optional[HelpFormatter] = ...,
|
||||
add_help_option: bool = ...,
|
||||
prog: Optional[_Text] = ...,
|
||||
epilog: Optional[_Text] = ...) -> None: ...
|
||||
def __init__(self,
|
||||
usage: Optional[_Text] = ...,
|
||||
option_list: Iterable[Option] = ...,
|
||||
option_class: Option = ...,
|
||||
version: Optional[_Text] = ...,
|
||||
conflict_handler: _Text = ...,
|
||||
description: Optional[_Text] = ...,
|
||||
formatter: Optional[HelpFormatter] = ...,
|
||||
add_help_option: bool = ...,
|
||||
prog: Optional[_Text] = ...,
|
||||
epilog: Optional[_Text] = ...) -> None: ...
|
||||
def _add_help_option(self) -> None: ...
|
||||
def _add_version_option(self) -> None: ...
|
||||
def _create_option_list(self) -> None: ...
|
||||
|
||||
@@ -28,7 +28,7 @@ if sys.version_info >= (3, 4):
|
||||
def loads(data: bytes, *, fmt: Optional[PlistFormat] = ...,
|
||||
use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ...
|
||||
def dump(value: Mapping[str, Any], fp: IO[bytes], *,
|
||||
fmt: PlistFormat =..., sort_keys: bool = ...,
|
||||
fmt: PlistFormat = ..., sort_keys: bool = ...,
|
||||
skipkeys: bool = ...) -> None: ...
|
||||
def dumps(value: Mapping[str, Any], *, fmt: PlistFormat = ...,
|
||||
skipkeys: bool = ..., sort_keys: bool = ...) -> bytes: ...
|
||||
|
||||
@@ -509,11 +509,9 @@ class socket:
|
||||
proto: int
|
||||
|
||||
if sys.version_info < (3,):
|
||||
def __init__(self, family: int = ..., type: int = ...,
|
||||
proto: int = ...) -> None: ...
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, family: int = ..., type: int = ...,
|
||||
proto: int = ..., fileno: Optional[int] = ...) -> None: ...
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: Optional[int] = ...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
def __enter__(self: _SelfT) -> _SelfT: ...
|
||||
@@ -556,7 +554,7 @@ class socket:
|
||||
def recv_into(self, buffer: _WriteBuffer, nbytes: int,
|
||||
flags: int = ...) -> int: ...
|
||||
def send(self, data: bytes, flags: int = ...) -> int: ...
|
||||
def sendall(self, data: bytes, flags: int =...) -> None:
|
||||
def sendall(self, data: bytes, flags: int = ...) -> None:
|
||||
... # return type: None on success
|
||||
@overload
|
||||
def sendto(self, data: bytes, address: Union[tuple, str]) -> int: ...
|
||||
|
||||
@@ -165,9 +165,7 @@ if sys.version_info < (3,) or sys.version_info >= (3, 4):
|
||||
ALERT_DESCRIPTION_USER_CANCELLED: int
|
||||
|
||||
if sys.version_info < (3,) or sys.version_info >= (3, 4):
|
||||
_PurposeType = NamedTuple('_PurposeType',
|
||||
[('nid', int), ('shortname', str),
|
||||
('longname', str), ('oid', str)])
|
||||
_PurposeType = NamedTuple('_PurposeType', [('nid', int), ('shortname', str), ('longname', str), ('oid', str)])
|
||||
class Purpose:
|
||||
SERVER_AUTH: _PurposeType
|
||||
CLIENT_AUTH: _PurposeType
|
||||
|
||||
@@ -39,15 +39,15 @@ if sys.version_info < (3,):
|
||||
TAR_GZIPPED = ... # type: int
|
||||
|
||||
def open(name: Optional[_Path] = ..., mode: str = ...,
|
||||
fileobj: Optional[IO[bytes]] = ..., bufsize: int = ...,
|
||||
*, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ...,
|
||||
dereference: Optional[bool] = ...,
|
||||
ignore_zeros: Optional[bool] = ...,
|
||||
encoding: Optional[str] = ..., errors: str = ...,
|
||||
pax_headers: Optional[Mapping[str, str]] = ...,
|
||||
debug: Optional[int] = ...,
|
||||
errorlevel: Optional[int] = ...,
|
||||
compresslevel: Optional[int] = ...) -> TarFile: ...
|
||||
fileobj: Optional[IO[bytes]] = ..., bufsize: int = ...,
|
||||
*, format: Optional[int] = ..., tarinfo: Optional[TarInfo] = ...,
|
||||
dereference: Optional[bool] = ...,
|
||||
ignore_zeros: Optional[bool] = ...,
|
||||
encoding: Optional[str] = ..., errors: str = ...,
|
||||
pax_headers: Optional[Mapping[str, str]] = ...,
|
||||
debug: Optional[int] = ...,
|
||||
errorlevel: Optional[int] = ...,
|
||||
compresslevel: Optional[int] = ...) -> TarFile: ...
|
||||
|
||||
|
||||
class TarFile(Iterable[TarInfo]):
|
||||
|
||||
@@ -12,7 +12,7 @@ default_timer = ... # type: _Timer
|
||||
class Timer:
|
||||
if sys.version_info >= (3, 5):
|
||||
def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...,
|
||||
globals: Optional[Dict[str, Any]] =...) -> None: ...
|
||||
globals: Optional[Dict[str, Any]] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...) -> None: ...
|
||||
def print_exc(self, file: Optional[IO[str]] = ...) -> None: ...
|
||||
@@ -23,9 +23,9 @@ class Timer:
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...,
|
||||
number: int = ..., globals: Optional[Dict[str, Any]] =...) -> float: ...
|
||||
number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> float: ...
|
||||
def repeat(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...,
|
||||
repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] =...) -> List[float]: ...
|
||||
repeat: int = ..., number: int = ..., globals: Optional[Dict[str, Any]] = ...) -> List[float]: ...
|
||||
else:
|
||||
def timeit(stmt: _stmt = ..., setup: _stmt = ..., timer: _Timer = ...,
|
||||
number: int = ...) -> float: ...
|
||||
|
||||
@@ -10,15 +10,15 @@ _default = TypeVar('_default')
|
||||
def bidirectional(__chr: Text) -> Text: ...
|
||||
def category(__chr: Text) -> Text: ...
|
||||
def combining(__chr: Text) -> int: ...
|
||||
def decimal(__chr: Text, __default: _default=...) -> Union[int, _default]: ...
|
||||
def decimal(__chr: Text, __default: _default = ...) -> Union[int, _default]: ...
|
||||
def decomposition(__chr: Text) -> Text: ...
|
||||
def digit(__chr: Text, __default: _default=...) -> Union[int, _default]: ...
|
||||
def digit(__chr: Text, __default: _default = ...) -> Union[int, _default]: ...
|
||||
def east_asian_width(__chr: Text) -> Text: ...
|
||||
def lookup(__name: Union[Text, bytes]) -> Text: ...
|
||||
def mirrored(__chr: Text) -> int: ...
|
||||
def name(__chr: Text, __default: _default=...) -> Union[Text, _default]: ...
|
||||
def name(__chr: Text, __default: _default = ...) -> Union[Text, _default]: ...
|
||||
def normalize(__form: Text, __unistr: Text) -> Text: ...
|
||||
def numeric(__chr: Text, __default: _default=...) -> Union[float, _default]: ...
|
||||
def numeric(__chr: Text, __default: _default = ...) -> Union[float, _default]: ...
|
||||
|
||||
class UCD(object):
|
||||
# The methods below are constructed from the same array in C
|
||||
@@ -27,12 +27,12 @@ class UCD(object):
|
||||
def bidirectional(self, __chr: Text) -> str: ...
|
||||
def category(self, __chr: Text) -> str: ...
|
||||
def combining(self, __chr: Text) -> int: ...
|
||||
def decimal(self, __chr: Text, __default: _default=...) -> Union[int, _default]: ...
|
||||
def decimal(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ...
|
||||
def decomposition(self, __chr: Text) -> str: ...
|
||||
def digit(self, __chr: Text, __default: _default=...) -> Union[int, _default]: ...
|
||||
def digit(self, __chr: Text, __default: _default = ...) -> Union[int, _default]: ...
|
||||
def east_asian_width(self, __chr: Text) -> str: ...
|
||||
def lookup(self, __name: Union[Text, bytes]) -> Text: ...
|
||||
def mirrored(self, __chr: Text) -> int: ...
|
||||
def name(self, __chr: Text, __default: _default=...) -> Union[Text, _default]: ...
|
||||
def name(self, __chr: Text, __default: _default = ...) -> Union[Text, _default]: ...
|
||||
def normalize(self, __form: Text, __unistr: Text) -> Text: ...
|
||||
def numeric(self, __chr: Text, __default: _default=...) -> Union[float, _default]: ...
|
||||
def numeric(self, __chr: Text, __default: _default = ...) -> Union[float, _default]: ...
|
||||
|
||||
@@ -22,13 +22,12 @@ def simplefilter(action: str, category: Type[Warning] = ..., lineno: int = ...,
|
||||
def resetwarnings() -> None: ...
|
||||
|
||||
_Record = NamedTuple('_Record',
|
||||
[('message', str),
|
||||
('category', Type[Warning]),
|
||||
('filename', str),
|
||||
('lineno', int),
|
||||
('file', Optional[TextIO]),
|
||||
('line', Optional[str])]
|
||||
)
|
||||
[('message', str),
|
||||
('category', Type[Warning]),
|
||||
('filename', str),
|
||||
('lineno', int),
|
||||
('file', Optional[TextIO]),
|
||||
('line', Optional[str])])
|
||||
|
||||
class catch_warnings:
|
||||
def __init__(self, *, record: bool = ...,
|
||||
|
||||
@@ -9,9 +9,9 @@ XINCLUDE_FALLBACK = ... # type: str
|
||||
|
||||
class FatalIncludeError(SyntaxError): ...
|
||||
|
||||
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
|
||||
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str] = ...) -> Union[str, Element]: ...
|
||||
|
||||
# TODO: loader is of type default_loader ie it takes a callable that has the
|
||||
# same signature as default_loader. But default_loader has a keyword argument
|
||||
# Which can't be represented using Callable...
|
||||
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
|
||||
def include(elem: Element, loader: Callable[..., Union[str, Element]] = ...) -> None: ...
|
||||
|
||||
@@ -9,7 +9,7 @@ _token = Tuple[str, str]
|
||||
_next = Callable[[], _token]
|
||||
_callback = Callable[[_SelectorContext, List[Element]], Generator[Element, None, None]]
|
||||
|
||||
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
|
||||
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str] = ...) -> Generator[_token, None, None]: ...
|
||||
def get_parent_map(context: _SelectorContext) -> Dict[Element, Element]: ...
|
||||
def prepare_child(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_star(next: _next, token: _token) -> _callback: ...
|
||||
@@ -27,7 +27,7 @@ class _SelectorContext:
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def iterfind(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
|
||||
def find(elem: Element, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
|
||||
def findall(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
|
||||
def findtext(elem: Element, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
|
||||
def iterfind(elem: Element, path: str, namespaces: Dict[str, str] = ...) -> List[Element]: ...
|
||||
def find(elem: Element, path: str, namespaces: Dict[str, str] = ...) -> Optional[Element]: ...
|
||||
def findall(elem: Element, path: str, namespaces: Dict[str, str] = ...) -> List[Element]: ...
|
||||
def findtext(elem: Element, path: str, default: _T = ..., namespaces: Dict[str, str] = ...) -> Union[_T, str]: ...
|
||||
|
||||
@@ -46,24 +46,24 @@ class Element(MutableSequence[Element]):
|
||||
attrib = ... # type: Dict[_str_result_type, _str_result_type]
|
||||
text = ... # type: Optional[_str_result_type]
|
||||
tail = ... # type: Optional[_str_result_type]
|
||||
def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> None: ...
|
||||
def __init__(self, tag: Union[_str_argument_type, Callable[..., Element]], attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> None: ...
|
||||
def append(self, subelement: Element) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> Element: ...
|
||||
def extend(self, elements: Iterable[Element]) -> None: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Optional[Element]: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def findtext(self, path: _str_argument_type, default: _T=..., namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Union[_T, _str_result_type]: ...
|
||||
def get(self, key: _str_argument_type, default: _T=...) -> Union[_str_result_type, _T]: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> Optional[Element]: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> List[Element]: ...
|
||||
def findtext(self, path: _str_argument_type, default: _T = ..., namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> Union[_T, _str_result_type]: ...
|
||||
def get(self, key: _str_argument_type, default: _T = ...) -> Union[_str_result_type, _T]: ...
|
||||
def getchildren(self) -> List[Element]: ...
|
||||
def getiterator(self, tag: _str_argument_type=...) -> List[Element]: ...
|
||||
def getiterator(self, tag: _str_argument_type = ...) -> List[Element]: ...
|
||||
if sys.version_info >= (3, 2):
|
||||
def insert(self, index: int, subelement: Element) -> None: ...
|
||||
else:
|
||||
def insert(self, index: int, element: Element) -> None: ...
|
||||
def items(self) -> ItemsView[_str_result_type, _str_result_type]: ...
|
||||
def iter(self, tag: _str_argument_type=...) -> Generator[Element, None, None]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def iter(self, tag: _str_argument_type = ...) -> Generator[Element, None, None]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> List[Element]: ...
|
||||
def itertext(self) -> Generator[_str_result_type, None, None]: ...
|
||||
def keys(self) -> KeysView[_str_result_type]: ...
|
||||
def makeelement(self, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]) -> Element: ...
|
||||
@@ -82,60 +82,60 @@ class Element(MutableSequence[Element]):
|
||||
def __setitem__(self, s: slice, o: Iterable[Element]) -> None: ...
|
||||
|
||||
|
||||
def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> Element: ...
|
||||
def Comment(text: _str_argument_type=...) -> Element: ...
|
||||
def ProcessingInstruction(target: _str_argument_type, text: _str_argument_type=...) -> Element: ...
|
||||
def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type] = ..., **extra: _str_argument_type) -> Element: ...
|
||||
def Comment(text: _str_argument_type = ...) -> Element: ...
|
||||
def ProcessingInstruction(target: _str_argument_type, text: _str_argument_type = ...) -> Element: ...
|
||||
|
||||
PI = ... # type: Callable[..., Element]
|
||||
|
||||
class QName:
|
||||
text = ... # type: str
|
||||
def __init__(self, text_or_uri: _str_argument_type, tag: _str_argument_type=...) -> None: ...
|
||||
def __init__(self, text_or_uri: _str_argument_type, tag: _str_argument_type = ...) -> None: ...
|
||||
|
||||
|
||||
_file_or_filename = Union[str, bytes, int, IO[Any]]
|
||||
|
||||
class ElementTree:
|
||||
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
|
||||
def __init__(self, element: Element = ..., file: _file_or_filename = ...) -> None: ...
|
||||
def getroot(self) -> Element: ...
|
||||
def parse(self, source: _file_or_filename, parser: XMLParser=...) -> Element: ...
|
||||
def iter(self, tag: _str_argument_type=...) -> Generator[Element, None, None]: ...
|
||||
def getiterator(self, tag: _str_argument_type=...) -> List[Element]: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Optional[Element]: ...
|
||||
def findtext(self, path: _str_argument_type, default: _T=..., namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> Union[_T, _str_result_type]: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type]=...) -> List[Element]: ...
|
||||
def parse(self, source: _file_or_filename, parser: XMLParser = ...) -> Element: ...
|
||||
def iter(self, tag: _str_argument_type = ...) -> Generator[Element, None, None]: ...
|
||||
def getiterator(self, tag: _str_argument_type = ...) -> List[Element]: ...
|
||||
def find(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> Optional[Element]: ...
|
||||
def findtext(self, path: _str_argument_type, default: _T = ..., namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> Union[_T, _str_result_type]: ...
|
||||
def findall(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> List[Element]: ...
|
||||
def iterfind(self, path: _str_argument_type, namespaces: Dict[_str_argument_type, _str_argument_type] = ...) -> List[Element]: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: _str_argument_type=..., method: str=..., *, short_empty_elements: bool=...) -> None: ...
|
||||
def write(self, file_or_filename: _file_or_filename, encoding: str = ..., xml_declaration: Optional[bool] = ..., default_namespace: _str_argument_type = ..., method: str = ..., *, short_empty_elements: bool = ...) -> None: ...
|
||||
else:
|
||||
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: _str_argument_type=..., method: str=...) -> None: ...
|
||||
def write(self, file_or_filename: _file_or_filename, encoding: str = ..., xml_declaration: Optional[bool] = ..., default_namespace: _str_argument_type = ..., method: str = ...) -> None: ...
|
||||
def write_c14n(self, file: _file_or_filename) -> None: ...
|
||||
|
||||
def register_namespace(prefix: _str_argument_type, uri: _str_argument_type) -> None: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
def tostring(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> _tostring_result_type: ...
|
||||
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[_tostring_result_type]: ...
|
||||
def tostring(element: Element, encoding: str = ..., method: str = ..., *, short_empty_elements: bool = ...) -> _tostring_result_type: ...
|
||||
def tostringlist(element: Element, encoding: str = ..., method: str = ..., *, short_empty_elements: bool = ...) -> List[_tostring_result_type]: ...
|
||||
else:
|
||||
def tostring(element: Element, encoding: str=..., method: str=...) -> _tostring_result_type: ...
|
||||
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[_tostring_result_type]: ...
|
||||
def tostring(element: Element, encoding: str = ..., method: str = ...) -> _tostring_result_type: ...
|
||||
def tostringlist(element: Element, encoding: str = ..., method: str = ...) -> List[_tostring_result_type]: ...
|
||||
def dump(elem: Element) -> None: ...
|
||||
def parse(source: _file_or_filename, parser: XMLParser=...) -> ElementTree: ...
|
||||
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: XMLParser=...) -> Iterator[Tuple[str, Any]]: ...
|
||||
def parse(source: _file_or_filename, parser: XMLParser = ...) -> ElementTree: ...
|
||||
def iterparse(source: _file_or_filename, events: Sequence[str] = ..., parser: XMLParser = ...) -> Iterator[Tuple[str, Any]]: ...
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
class XMLPullParser:
|
||||
def __init__(self, events: Sequence[str]=..., *, _parser: XMLParser=...) -> None: ...
|
||||
def __init__(self, events: Sequence[str] = ..., *, _parser: XMLParser = ...) -> None: ...
|
||||
def feed(self, data: bytes) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
|
||||
|
||||
def XML(text: _parser_input_type, parser: XMLParser=...) -> Element: ...
|
||||
def XMLID(text: _parser_input_type, parser: XMLParser=...) -> Tuple[Element, Dict[_str_result_type, Element]]: ...
|
||||
def XML(text: _parser_input_type, parser: XMLParser = ...) -> Element: ...
|
||||
def XMLID(text: _parser_input_type, parser: XMLParser = ...) -> Tuple[Element, Dict[_str_result_type, Element]]: ...
|
||||
|
||||
# This is aliased to XML in the source.
|
||||
fromstring = XML
|
||||
|
||||
def fromstringlist(sequence: Sequence[_parser_input_type], parser: XMLParser=...) -> Element: ...
|
||||
def fromstringlist(sequence: Sequence[_parser_input_type], parser: XMLParser = ...) -> Element: ...
|
||||
|
||||
# This type is both not precise enough and too precise. The TreeBuilder
|
||||
# requires the elementfactory to accept tag and attrs in its args and produce
|
||||
@@ -149,7 +149,7 @@ def fromstringlist(sequence: Sequence[_parser_input_type], parser: XMLParser=...
|
||||
_ElementFactory = Callable[[Any, Dict[Any, Any]], Element]
|
||||
|
||||
class TreeBuilder:
|
||||
def __init__(self, element_factory: _ElementFactory=...) -> None: ...
|
||||
def __init__(self, element_factory: _ElementFactory = ...) -> None: ...
|
||||
def close(self) -> Element: ...
|
||||
def data(self, data: _parser_input_type) -> None: ...
|
||||
def start(self, tag: _parser_input_type, attrs: Dict[_parser_input_type, _parser_input_type]) -> Element: ...
|
||||
@@ -161,7 +161,7 @@ class XMLParser:
|
||||
# TODO-what is entity used for???
|
||||
entity = ... # type: Any
|
||||
version = ... # type: str
|
||||
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
|
||||
def __init__(self, html: int = ..., target: TreeBuilder = ..., encoding: str = ...) -> None: ...
|
||||
def doctype(self, name: str, pubid: str, system: str) -> None: ...
|
||||
def close(self) -> Element: ...
|
||||
def feed(self, data: _parser_input_type) -> None: ...
|
||||
|
||||
@@ -10,8 +10,7 @@ def quoteattr(data: Text, entities: Mapping[Text, Text] = ...) -> Text: ...
|
||||
|
||||
class XMLGenerator(handler.ContentHandler):
|
||||
if sys.version_info >= (3, 0):
|
||||
def __init__(self, out=..., encoding=...,
|
||||
short_empty_elements: bool=...) -> None: ...
|
||||
def __init__(self, out=..., encoding=..., short_empty_elements: bool = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, out=..., encoding=...) -> None: ...
|
||||
def startDocument(self): ...
|
||||
|
||||
@@ -22,7 +22,7 @@ def dataclass(_cls: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
@overload
|
||||
def dataclass(*, init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ...,
|
||||
unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
unsafe_hash: bool = ..., frozen: bool = ...) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
|
||||
|
||||
class Field(Generic[_T]):
|
||||
@@ -41,18 +41,18 @@ class Field(Generic[_T]):
|
||||
# to understand the magic that happens at runtime.
|
||||
@overload # `default` and `default_factory` are optional and mutually exclusive.
|
||||
def field(*, default: _T,
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> _T: ...
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> _T: ...
|
||||
|
||||
@overload
|
||||
def field(*, default_factory: Callable[[], _T],
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> _T: ...
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> _T: ...
|
||||
|
||||
@overload
|
||||
def field(*,
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> Any: ...
|
||||
init: bool = ..., repr: bool = ..., hash: Optional[bool] = ..., compare: bool = ...,
|
||||
metadata: Optional[Mapping[str, Any]] = ...) -> Any: ...
|
||||
|
||||
|
||||
def fields(class_or_instance: Any) -> Tuple[Field[Any], ...]: ...
|
||||
@@ -64,7 +64,8 @@ class FrozenInstanceError(AttributeError): ...
|
||||
class InitVar(Generic[_T]): ...
|
||||
|
||||
def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *,
|
||||
bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ..., frozen: bool = ...): ...
|
||||
bases: Tuple[type, ...] = ..., namespace: Optional[Dict[str, Any]] = ...,
|
||||
init: bool = ..., repr: bool = ..., eq: bool = ..., order: bool = ..., hash: bool = ...,
|
||||
frozen: bool = ...): ...
|
||||
|
||||
def replace(obj: _T, **changes: Any) -> _T: ...
|
||||
|
||||
@@ -22,8 +22,7 @@ _TransProtPair = Tuple[BaseTransport, BaseProtocol]
|
||||
class Handle:
|
||||
_cancelled = False
|
||||
_args = ... # type: List[Any]
|
||||
def __init__(self, callback: Callable[..., Any], args: List[Any],
|
||||
loop: AbstractEventLoop) -> None: ...
|
||||
def __init__(self, callback: Callable[..., Any], args: List[Any], loop: AbstractEventLoop) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def cancel(self) -> None: ...
|
||||
def _run(self) -> None: ...
|
||||
@@ -90,7 +89,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
@coroutine
|
||||
def run_in_executor(self, executor: Any,
|
||||
func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ...
|
||||
func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ...
|
||||
@abstractmethod
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
@@ -99,7 +98,8 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
|
||||
# https://github.com/python/mypy/issues/2509
|
||||
def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *,
|
||||
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ...
|
||||
family: int = ..., type: int = ..., proto: int = ...,
|
||||
flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ...
|
||||
@abstractmethod
|
||||
@coroutine
|
||||
def getnameinfo(self, sockaddr: tuple, flags: int = ...) -> Generator[Any, None, Tuple[str, int]]: ...
|
||||
|
||||
@@ -64,9 +64,9 @@ class FlowControlMixin(protocols.Protocol): ...
|
||||
|
||||
class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
|
||||
def __init__(self,
|
||||
stream_reader: StreamReader,
|
||||
client_connected_cb: _ClientConnectedCallback = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
|
||||
stream_reader: StreamReader,
|
||||
client_connected_cb: _ClientConnectedCallback = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
|
||||
def connection_made(self, transport: transports.BaseTransport) -> None: ...
|
||||
def connection_lost(self, exc: Optional[Exception]) -> None: ...
|
||||
def data_received(self, data: bytes) -> None: ...
|
||||
@@ -74,10 +74,10 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
|
||||
|
||||
class StreamWriter:
|
||||
def __init__(self,
|
||||
transport: transports.BaseTransport,
|
||||
protocol: protocols.BaseProtocol,
|
||||
reader: StreamReader,
|
||||
loop: events.AbstractEventLoop) -> None: ...
|
||||
transport: transports.BaseTransport,
|
||||
protocol: protocols.BaseProtocol,
|
||||
reader: StreamReader,
|
||||
loop: events.AbstractEventLoop) -> None: ...
|
||||
@property
|
||||
def transport(self) -> transports.BaseTransport: ...
|
||||
def write(self, data: bytes) -> None: ...
|
||||
@@ -91,8 +91,8 @@ class StreamWriter:
|
||||
|
||||
class StreamReader:
|
||||
def __init__(self,
|
||||
limit: int = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
|
||||
limit: int = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...) -> None: ...
|
||||
def exception(self) -> Exception: ...
|
||||
def set_exception(self, exc: Exception) -> None: ...
|
||||
def set_transport(self, transport: transports.BaseTransport) -> None: ...
|
||||
|
||||
@@ -29,9 +29,9 @@ class Process:
|
||||
stderr = ... # type: Optional[streams.StreamReader]
|
||||
pid = ... # type: int
|
||||
def __init__(self,
|
||||
transport: transports.BaseTransport,
|
||||
protocol: protocols.BaseProtocol,
|
||||
loop: events.AbstractEventLoop) -> None: ...
|
||||
transport: transports.BaseTransport,
|
||||
protocol: protocols.BaseProtocol,
|
||||
loop: events.AbstractEventLoop) -> None: ...
|
||||
@property
|
||||
def returncode(self) -> int: ...
|
||||
@coroutine
|
||||
|
||||
@@ -53,8 +53,7 @@ def run_coroutine_threadsafe(coro: _FutureT[_T],
|
||||
loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
|
||||
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ..., timeout: Optional[float] = ...,
|
||||
return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
|
||||
def wait_for(fut: _FutureT[_T], timeout: Optional[float],
|
||||
*, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
|
||||
@@ -63,7 +63,7 @@ class staticmethod: # Special, only valid as a decorator.
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class classmethod: # Special, only valid as a decorator.
|
||||
__func__ = ... # type: function
|
||||
@@ -71,7 +71,7 @@ class classmethod: # Special, only valid as a decorator.
|
||||
|
||||
def __init__(self, f: function) -> None: ...
|
||||
def __new__(cls: Type[_T], *args: Any, **kwargs: Any) -> _T: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]]=...) -> function: ...
|
||||
def __get__(self, obj: _T, type: Optional[Type[_T]] = ...) -> function: ...
|
||||
|
||||
class type:
|
||||
__bases__ = ... # type: Tuple[type, ...]
|
||||
@@ -935,12 +935,10 @@ def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ...
|
||||
iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2,
|
||||
_T3, _T4, _T5]]: ...
|
||||
iter4: Iterable[_T4], iter5: Iterable[_T5]) -> Iterator[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[Any], iter2: Iterable[Any], iter3: Iterable[Any],
|
||||
iter4: Iterable[Any], iter5: Iterable[Any], iter6: Iterable[Any],
|
||||
|
||||
@@ -42,7 +42,8 @@ class Future(Generic[_T]):
|
||||
class Executor:
|
||||
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ..., chunksize: int = ...) -> Iterator[_T]: ...
|
||||
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,
|
||||
chunksize: int = ...) -> Iterator[_T]: ...
|
||||
else:
|
||||
def map(self, func: Callable[..., _T], *iterables: Iterable[Any], timeout: Optional[float] = ...,) -> Iterator[_T]: ...
|
||||
def shutdown(self, wait: bool = ...) -> None: ...
|
||||
@@ -51,4 +52,5 @@ class Executor:
|
||||
|
||||
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
|
||||
|
||||
def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...
|
||||
def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]],
|
||||
Set[Future[_T]]]: ...
|
||||
|
||||
@@ -5,7 +5,7 @@ def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> Non
|
||||
|
||||
class Textbox:
|
||||
stripspaces: bool
|
||||
def __init__(self, w: _CursesWindow, insert_mode: bool= ...) -> None: ...
|
||||
def __init__(self, w: _CursesWindow, insert_mode: bool = ...) -> None: ...
|
||||
def edit(self, validate: Callable[[int], int]) -> str: ...
|
||||
def do_command(self, ch: Union[str, int]) -> None: ...
|
||||
def gather(self) -> str: ...
|
||||
|
||||
@@ -5,15 +5,10 @@ import sys
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
|
||||
def message_from_string(s: str, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_binary_file(fp: IO[bytes],
|
||||
_class: Callable[[], Message] = ..., *,
|
||||
policy: Policy = ...) -> Message: ...
|
||||
def message_from_string(s: str, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ...
|
||||
def message_from_bytes(s: bytes, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ...
|
||||
def message_from_file(fp: IO[str], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ...
|
||||
def message_from_binary_file(fp: IO[bytes], _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> Message: ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# base64mime
|
||||
|
||||
@@ -11,7 +11,7 @@ class Generator:
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
linesep: Optional[str] = ...) -> None: ...
|
||||
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
@@ -20,7 +20,7 @@ class BytesGenerator:
|
||||
maxheaderlen: int = ..., *,
|
||||
policy: Policy = ...) -> None: ...
|
||||
def flatten(self, msg: Message, unixfrom: bool = ...,
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
linesep: Optional[str] = ...) -> None: ...
|
||||
|
||||
class DecodedGenerator(Generator):
|
||||
# TODO `fmt` is positional
|
||||
|
||||
@@ -20,6 +20,6 @@ class Header:
|
||||
|
||||
def decode_header(header: Union[Header, str]) -> List[Tuple[bytes, Optional[str]]]: ...
|
||||
def make_header(decoded_seq: List[Tuple[bytes, Optional[str]]],
|
||||
maxlinelen: Optional[int] =...,
|
||||
maxlinelen: Optional[int] = ...,
|
||||
header_name: Optional[str] = ...,
|
||||
continuation_ws: str = ...) -> Header: ...
|
||||
|
||||
@@ -86,7 +86,7 @@ class Address:
|
||||
def __init__(self, display_name: str = ...,
|
||||
username: Optional[str] = ...,
|
||||
domain: Optional[str] = ...,
|
||||
addr_spec: Optional[str]=...) -> None: ...
|
||||
addr_spec: Optional[str] = ...) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class Group:
|
||||
|
||||
@@ -4,13 +4,8 @@
|
||||
|
||||
from typing import List, Tuple
|
||||
|
||||
def getopt(args: List[str], shortopts: str,
|
||||
longopts: List[str]=...) -> Tuple[List[Tuple[str, str]],
|
||||
List[str]]: ...
|
||||
|
||||
def gnu_getopt(args: List[str], shortopts: str,
|
||||
longopts: List[str]=...) -> Tuple[List[Tuple[str, str]],
|
||||
List[str]]: ...
|
||||
def getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ...
|
||||
def gnu_getopt(args: List[str], shortopts: str, longopts: List[str] = ...) -> Tuple[List[Tuple[str, str]], List[str]]: ...
|
||||
|
||||
class GetoptError(Exception):
|
||||
msg = ... # type: str
|
||||
|
||||
@@ -24,7 +24,7 @@ def find(domain: str, localedir: str = ..., languages: List[str] = ...,
|
||||
|
||||
def translation(domain: str, localedir: str = ..., languages: List[str] = ...,
|
||||
class_: Callable[[IO[str]], NullTranslations] = ...,
|
||||
fallback: bool =..., codeset: Any = ...) -> NullTranslations: ...
|
||||
fallback: bool = ..., codeset: Any = ...) -> NullTranslations: ...
|
||||
|
||||
def install(domain: str, localedir: str = ..., codeset: Any = ...,
|
||||
names: List[str] = ...): ...
|
||||
|
||||
@@ -69,7 +69,7 @@ class DefaultCookiePolicy(CookiePolicy):
|
||||
rfc2965: bool = ...,
|
||||
rfc2109_as_netscape: Optional[bool] = ...,
|
||||
hide_cookie2: bool = ..., strict_domain: bool = ...,
|
||||
strict_rfc2965_unverifiable: bool =...,
|
||||
strict_rfc2965_unverifiable: bool = ...,
|
||||
strict_ns_unverifiable: bool = ...,
|
||||
strict_ns_domain: int = ...,
|
||||
strict_ns_set_initial_dollar: bool = ...,
|
||||
|
||||
@@ -12,14 +12,14 @@ if sys.version_info >= (3, 7):
|
||||
|
||||
def open_binary(package: Package, resource: Resource) -> BinaryIO: ...
|
||||
def open_text(package: Package,
|
||||
resource: Resource,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> TextIO: ...
|
||||
resource: Resource,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> TextIO: ...
|
||||
def read_binary(package: Package, resource: Resource) -> bytes: ...
|
||||
def read_text(package: Package,
|
||||
resource: Resource,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> str: ...
|
||||
resource: Resource,
|
||||
encoding: str = ...,
|
||||
errors: str = ...) -> str: ...
|
||||
def path(package: Package, resource: Resource) -> ContextManager[Path]: ...
|
||||
def is_resource(package: Package, name: str) -> bool: ...
|
||||
def contents(package: Package) -> Iterator[str]: ...
|
||||
|
||||
@@ -7,52 +7,52 @@ if sys.version_info >= (3, 5):
|
||||
from .decoder import JSONDecodeError as JSONDecodeError
|
||||
|
||||
def dumps(obj: Any,
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Union[None, int, str] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> str: ...
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Union[None, int, str] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> str: ...
|
||||
|
||||
def dump(obj: Any,
|
||||
fp: IO[str],
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Union[None, int, str] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> None: ...
|
||||
fp: IO[str],
|
||||
skipkeys: bool = ...,
|
||||
ensure_ascii: bool = ...,
|
||||
check_circular: bool = ...,
|
||||
allow_nan: bool = ...,
|
||||
cls: Any = ...,
|
||||
indent: Union[None, int, str] = ...,
|
||||
separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable[[Any], Any]] = ...,
|
||||
sort_keys: bool = ...,
|
||||
**kwds: Any) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
_LoadsString = Union[str, bytes, bytearray]
|
||||
else:
|
||||
_LoadsString = str
|
||||
def loads(s: _LoadsString,
|
||||
encoding: Any = ..., # ignored and deprecated
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
encoding: Any = ..., # ignored and deprecated
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
|
||||
class _Reader(Protocol):
|
||||
def read(self) -> _LoadsString: ...
|
||||
|
||||
def load(fp: _Reader,
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
cls: Any = ...,
|
||||
object_hook: Optional[Callable[[Dict], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[Any, Any]]], Any]] = ...,
|
||||
**kwds: Any) -> Any: ...
|
||||
|
||||
@@ -19,10 +19,10 @@ class JSONDecoder:
|
||||
object_pairs_hook = ... # type: Callable[[List[Tuple[str, Any]]], Any]
|
||||
|
||||
def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = ...,
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ...
|
||||
parse_float: Optional[Callable[[str], Any]] = ...,
|
||||
parse_int: Optional[Callable[[str], Any]] = ...,
|
||||
parse_constant: Optional[Callable[[str], Any]] = ...,
|
||||
strict: bool = ...,
|
||||
object_pairs_hook: Optional[Callable[[List[Tuple[str, Any]]], Any]] = ...) -> None: ...
|
||||
def decode(self, s: str) -> Any: ...
|
||||
def raw_decode(self, s: str, idx: int = ...) -> Tuple[Any, int]: ...
|
||||
|
||||
@@ -12,8 +12,9 @@ class JSONEncoder:
|
||||
indent = ... # type: int
|
||||
|
||||
def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ...,
|
||||
check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ...,
|
||||
indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ..., default: Optional[Callable] = ...) -> None: ...
|
||||
check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ...,
|
||||
indent: Optional[int] = ..., separators: Optional[Tuple[str, str]] = ...,
|
||||
default: Optional[Callable] = ...) -> None: ...
|
||||
|
||||
def default(self, o: Any) -> Any: ...
|
||||
def encode(self, o: Any) -> str: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class Connection(object):
|
||||
def __exit__(self, exc_type, exc_value, exc_tb) -> None: ...
|
||||
def __init__(self, _in, _out) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def poll(self, timeout: float=...) -> bool: ...
|
||||
def poll(self, timeout: float = ...) -> bool: ...
|
||||
|
||||
class Listener(object):
|
||||
_backlog_queue = ... # type: Optional[Queue]
|
||||
@@ -32,4 +32,4 @@ class Listener(object):
|
||||
|
||||
|
||||
def Client(address) -> Connection: ...
|
||||
def Pipe(duplex: bool=...) -> Tuple[Connection, Connection]: ...
|
||||
def Pipe(duplex: bool = ...) -> Tuple[Connection, Connection]: ...
|
||||
|
||||
@@ -31,11 +31,11 @@ class Pool(ContextManager[Pool]):
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Mapping[str, Any] = ...) -> _T: ...
|
||||
def apply_async(self,
|
||||
func: Callable[..., _T],
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Mapping[str, Any] = ...,
|
||||
callback: Optional[Callable[[_T], None]] = ...,
|
||||
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ...
|
||||
func: Callable[..., _T],
|
||||
args: Iterable[Any] = ...,
|
||||
kwds: Mapping[str, Any] = ...,
|
||||
callback: Optional[Callable[[_T], None]] = ...,
|
||||
error_callback: Optional[Callable[[BaseException], None]] = ...) -> AsyncResult[_T]: ...
|
||||
def map(self,
|
||||
func: Callable[[_S], _T],
|
||||
iterable: Iterable[_S] = ...,
|
||||
|
||||
@@ -482,7 +482,7 @@ else:
|
||||
def renames(old: _PathType, new: _PathType) -> None: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def replace(src: _PathType, dst: _PathType, *,
|
||||
src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
src_dir_fd: Optional[int] = ..., dst_dir_fd: Optional[int] = ...) -> None: ...
|
||||
def rmdir(path: _PathType, *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
else:
|
||||
def rmdir(path: _PathType) -> None: ...
|
||||
|
||||
@@ -45,8 +45,13 @@ class stat_result:
|
||||
st_creator: int
|
||||
st_type: int
|
||||
|
||||
uname_result = NamedTuple('uname_result', [('sysname', str), ('nodename', str),
|
||||
('release', str), ('version', str), ('machine', str)])
|
||||
uname_result = NamedTuple('uname_result', [
|
||||
('sysname', str),
|
||||
('nodename', str),
|
||||
('release', str),
|
||||
('version', str),
|
||||
('machine', str),
|
||||
])
|
||||
|
||||
times_result = NamedTuple('times_result', [
|
||||
('user', float),
|
||||
|
||||
@@ -29,8 +29,7 @@ class Random(_random.Random):
|
||||
def sample(self, population: Union[Sequence[_T], AbstractSet[_T]], k: int) -> List[_T]: ...
|
||||
def random(self) -> float: ...
|
||||
def uniform(self, a: float, b: float) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ...,
|
||||
mode: float = ...) -> float: ...
|
||||
def triangular(self, low: float = ..., high: float = ..., mode: float = ...) -> float: ...
|
||||
def betavariate(self, alpha: float, beta: float) -> float: ...
|
||||
def expovariate(self, lambd: float) -> float: ...
|
||||
def gammavariate(self, alpha: float, beta: float) -> float: ...
|
||||
|
||||
@@ -23,7 +23,7 @@ if sys.version_info >= (3, 5):
|
||||
def NamedTemporaryFile(
|
||||
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
|
||||
newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ...,
|
||||
dir: Optional[AnyStr] = ..., delete: bool =...
|
||||
dir: Optional[AnyStr] = ..., delete: bool = ...
|
||||
) -> IO[Any]:
|
||||
...
|
||||
def SpooledTemporaryFile(
|
||||
@@ -61,7 +61,7 @@ else:
|
||||
def NamedTemporaryFile(
|
||||
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
|
||||
newline: Optional[str] = ..., suffix: str = ..., prefix: str = ...,
|
||||
dir: Optional[str] = ..., delete: bool =...
|
||||
dir: Optional[str] = ..., delete: bool = ...
|
||||
) -> IO[Any]:
|
||||
...
|
||||
def SpooledTemporaryFile(
|
||||
|
||||
@@ -51,8 +51,8 @@ class Request:
|
||||
unverifiable: bool
|
||||
method: Optional[str]
|
||||
def __init__(self, url: str, data: Optional[bytes] = ...,
|
||||
headers: Dict[str, str] =..., origin_req_host: Optional[str] = ...,
|
||||
unverifiable: bool = ..., method: Optional[str] = ...) -> None: ...
|
||||
headers: Dict[str, str] = ..., origin_req_host: Optional[str] = ...,
|
||||
unverifiable: bool = ..., method: Optional[str] = ...) -> None: ...
|
||||
def get_method(self) -> str: ...
|
||||
def add_header(self, key: str, val: str) -> None: ...
|
||||
def add_unredirected_header(self, key: str, val: str) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user