Fixing flake8 E231 errors

This commit is contained in:
Lukasz Langa
2016-12-19 22:22:14 -08:00
parent 93ec300dd4
commit 67e38b6806
26 changed files with 181 additions and 181 deletions

View File

@@ -42,7 +42,7 @@ class InterpolationDepthError(InterpolationError):
class ParsingError(Error):
filename = ... # type: str
errors = ... # type: list[Tuple[Any,Any]]
errors = ... # type: list[Tuple[Any, Any]]
def __init__(self, filename: str) -> None: ...
def append(self, lineno: Any, line: Any) -> None: ...
@@ -60,8 +60,8 @@ class RawConfigParser:
SECTCRE = ... # type: Any
OPTCRE = ... # type: Any
OPTCRE_NV = ... # type: Any
def __init__(self, defaults: dict[Any,Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> dict[Any,Any]: ...
def __init__(self, defaults: dict[Any, Any] = ..., dict_type: Any = ..., allow_no_value: bool = ...) -> None: ...
def defaults(self) -> dict[Any, Any]: ...
def sections(self) -> list[str]: ...
def add_section(self, section: str) -> None: ...
def has_section(self, section: str) -> bool: ...
@@ -69,11 +69,11 @@ class RawConfigParser:
def read(self, filenames: str) -> list[str]: ...
def readfp(self, fp: IO[str], filename: str = ...) -> None: ...
def get(self, section: str, option: str) -> str: ...
def items(self, section: str) -> list[Tuple[Any,Any]]: ...
def items(self, section: str) -> list[Tuple[Any, Any]]: ...
def _get(self, section: str, conv: type, option: str) -> Any: ...
def getint(self, section: str, option: str) -> int: ...
def getfloat(self, section: str, option: str) -> float: ...
_boolean_states = ... # type: dict[str,bool]
_boolean_states = ... # type: dict[str, bool]
def getboolean(self, section: str, option: str) -> bool: ...
def optionxform(self, optionstr: str) -> str: ...
def has_option(self, section: str, option: str) -> bool: ...
@@ -86,7 +86,7 @@ class RawConfigParser:
class ConfigParser(RawConfigParser):
_KEYCRE = ... # type: Any
def get(self, section: str, option: str, raw: bool = ..., vars: dict = ...) -> Any: ...
def items(self, section: str, raw: bool = ..., vars: dict = ...) -> list[Tuple[str,Any]]: ...
def items(self, section: str, raw: bool = ..., vars: dict = ...) -> list[Tuple[str, Any]]: ...
def _interpolate(self, section: str, option: str, rawval: Any, vars: Any) -> str: ...
def _interpolation_replace(self, match: Any) -> str: ...

View File

@@ -15,41 +15,41 @@ def register(search_function: Callable[[str], Any]) -> None: ...
def register_error(errors: str, handler: _Handler) -> None: ...
def lookup(a: str) -> codecs.CodecInfo: ...
def lookup_error(a: str) -> _Handler: ...
def decode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
def encode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
def decode(obj: Any, encoding: str = ..., errors: str = ...) -> Any: ...
def encode(obj: Any, encoding: str = ..., errors: str = ...) -> Any: ...
def charmap_build(a: unicode) -> _EncodingMap: ...
def ascii_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def ascii_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def ascii_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def ascii_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def charbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def charmap_decode(data: AnyStr, errors: str = ..., mapping: Optional[_EncodingMap] = ...) -> Tuple[unicode, int]: ...
def charmap_encode(data: AnyStr, errors: str, mapping: Optional[_EncodingMap] = ...) -> Tuple[str, int]: ...
def escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def latin_1_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def latin_1_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def raw_unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def raw_unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def readbuffer_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def unicode_internal_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
def unicode_internal_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def utf_16_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_16_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_16_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_16_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_16_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_32_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_32_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_32_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_32_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_7_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_7_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_8_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
def utf_8_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def escape_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def escape_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def latin_1_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def latin_1_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def raw_unicode_escape_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def raw_unicode_escape_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def readbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def unicode_escape_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def unicode_escape_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def unicode_internal_decode(data: AnyStr, errors: str = ...) -> Tuple[unicode, int]: ...
def unicode_internal_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def utf_16_be_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_16_be_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_16_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_ex_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_16_le_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_16_le_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_be_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_32_be_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_32_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_ex_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_32_le_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_32_le_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_7_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_7_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_8_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[unicode, int]: ...
def utf_8_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...

View File

@@ -16,7 +16,7 @@ class SRE_Match(object):
@overload
def group(self) -> str: ...
@overload
def group(self, group:int = ...) -> Optional[str]: ...
def group(self, group: int = ...) -> Optional[str]: ...
def groupdict(self) -> Dict[int, Optional[str]]: ...
def groups(self) -> Tuple[Optional[str]]: ...
def span(self) -> Tuple[int, int]:
@@ -33,17 +33,17 @@ class SRE_Pattern(object):
groups = ... # type: int
groupindex = ... # type: Mapping[int, int]
indexgroup = ... # type: Sequence[int]
def findall(self, source: str, pos:int = ..., endpos:int = ...) -> List[Union[tuple, str]]: ...
def finditer(self, source: str, pos: int = ..., endpos:int = ...) -> Iterable[Union[tuple, str]]: ...
def match(self, pattern, pos: int = ..., endpos:int = ...) -> SRE_Match: ...
def findall(self, source: str, pos: int = ..., endpos: int = ...) -> List[Union[tuple, str]]: ...
def finditer(self, source: str, pos: int = ..., endpos: int = ...) -> Iterable[Union[tuple, str]]: ...
def match(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ...
def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ...
def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ...
def split(self, source: str, maxsplit:int = ...) -> List[Optional[str]]: ...
def sub(self, repl: str, string: str, count:int = ...) -> tuple: ...
def subn(self, repl: str, string: str, count:int = ...) -> tuple: ...
def split(self, source: str, maxsplit: int = ...) -> List[Optional[str]]: ...
def sub(self, repl: str, string: str, count: int = ...) -> tuple: ...
def subn(self, repl: str, string: str, count: int = ...) -> tuple: ...
def compile(pattern: str, flags: int, code: List[int],
groups:int = ...,
groups: int = ...,
groupindex: Mapping[int, int] = ...,
indexgroup: Sequence[int] = ...) -> SRE_Pattern:
raise OverflowError()

View File

@@ -11,8 +11,8 @@ class Struct(object):
def __init__(self, fmt: str) -> None: ...
def pack_into(self, buffer: bytearray, offset: int, obj: Any) -> None: ...
def pack(self, *args) -> str: ...
def unpack(self, s:str) -> Tuple[Any]: ...
def unpack_from(self, buffer: bytearray, offset:int = ...) -> Tuple[Any]: ...
def unpack(self, s: str) -> Tuple[Any]: ...
def unpack_from(self, buffer: bytearray, offset: int = ...) -> Tuple[Any]: ...
def _clearcache() -> None: ...
def calcsize(fmt: str) -> int: ...

View File

@@ -4,8 +4,8 @@ default_action = ... # type: str
filters = ... # type: List[tuple]
once_registry = ... # type: dict
def warn(message: Warning, category:type = ..., stacklevel:int = ...) -> None: ...
def warn_explicit(message: Warning, category:type,
def warn(message: Warning, category: type = ..., stacklevel: int = ...) -> None: ...
def warn_explicit(message: Warning, category: type,
filename: str, lineno: int,
module:Any = ..., registry:dict = ...,
module_globals:dict = ...) -> None: ...
module: Any = ..., registry: dict = ...,
module_globals: dict = ...) -> None: ...

View File

@@ -13,5 +13,5 @@ def getopt(args: List[str], shortopts: str,
List[str]]: ...
def gnu_getopt(args: List[str], shortopts: str,
longopts: List[str]=...) -> Tuple[List[Tuple[str,str]],
longopts: List[str]=...) -> Tuple[List[Tuple[str, str]],
List[str]]: ...

View File

@@ -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): ...

View File

@@ -13,5 +13,5 @@ class struct_passwd(tuple):
pw_uid = ... # type: int
def getpwall() -> List[struct_passwd]: ...
def getpwnam(name:str) -> struct_passwd: ...
def getpwuid(uid:int) -> struct_passwd: ...
def getpwnam(name: str) -> struct_passwd: ...
def getpwuid(uid: int) -> struct_passwd: ...

View File

@@ -2,7 +2,7 @@
# Ron Murawski <ron@horizonchess.com>
# 'bytes' support added by Jukka Lehtosalo
# based on: http://docs.python.org/2.7/library/re.html
# based on: http: //docs.python.org/2.7/library/re.html
from typing import (
List, Iterator, overload, Callable, Tuple, Sequence, Dict,
@@ -36,24 +36,24 @@ def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
@overload
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
@overload
def search(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
@overload
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
@overload
def match(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
@overload
def split(pattern: Union[str, unicode], string: AnyStr,
maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
@overload
def split(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr,
def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
@overload
def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ...
@overload
def findall(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ...
def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ...
# Return an iterator yielding match objects over all non-overlapping matches
# for the RE pattern in string. The string is scanned left-to-right, and
@@ -63,7 +63,7 @@ def findall(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr, flags
def finditer(pattern: Union[str, unicode], string: AnyStr,
flags: int = ...) -> Iterator[Match[AnyStr]]: ...
@overload
def finditer(pattern: Union[Pattern[str],Pattern[unicode]], string: AnyStr,
def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,
flags: int = ...) -> Iterator[Match[AnyStr]]: ...
@overload
@@ -73,10 +73,10 @@ def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int =
def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
@overload
def sub(pattern: Union[Pattern[str],Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> AnyStr: ...
@overload
def sub(pattern: Union[Pattern[str],Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...
@overload
@@ -87,10 +87,10 @@ def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Union[Pattern[str],Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...
@overload
def subn(pattern: Union[Pattern[str],Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],
string: AnyStr, count: int = ...,
flags: int = ...) -> Tuple[AnyStr, int]: ...

View File

@@ -9,10 +9,10 @@ whitespace = ... # type: str
def atof(a: str) -> float:
raise DeprecationWarning()
def atoi(a: str, base:int = ...) -> int:
def atoi(a: str, base: int = ...) -> int:
raise DeprecationWarning()
def atol(a: str, base:int = ...) -> long:
def atol(a: str, base: int = ...) -> long:
raise DeprecationWarning()
def capitalize(s: str) -> str:
@@ -21,18 +21,18 @@ def capitalize(s: str) -> str:
def count(s: str, sub: str, start: int = ..., end: int = ...) -> int:
raise DeprecationWarning()
def expandtabs(string:str, tabsize:int = ...) -> str:
def expandtabs(string: str, tabsize: int = ...) -> str:
raise DeprecationWarning()
raise OverflowError()
def find(s: str, sub: str, start: int = ..., end: int = ...) -> int:
raise DeprecationWarning()
def join(list: Sequence[str], sep:str = ...) -> str:
def join(list: Sequence[str], sep: str = ...) -> str:
raise DeprecationWarning()
raise OverflowError()
def joinfields(list: Sequence[str], sep:str = ...) -> str:
def joinfields(list: Sequence[str], sep: str = ...) -> str:
raise DeprecationWarning()
raise OverflowError()
@@ -44,7 +44,7 @@ def lstrip(s: str) -> str:
def maketrans(frm: str, to: str) -> str: ...
def replace(s: str, old: str, new: str, maxsplit:int = ...) -> str:
def replace(s: str, old: str, new: str, maxsplit: int = ...) -> str:
raise DeprecationWarning()
def rfind(s: str, sub: str, start: int = ..., end: int = ...) -> int:

View File

@@ -1,7 +1,7 @@
# Stubs for tempfile
# Ron Murawski <ron@horizonchess.com>
# based on http://docs.python.org/3.3/library/tempfile.html
# based on http: //docs.python.org/3.3/library/tempfile.html
# Adapted for Python 2.7 by Michal Pokorny
# TODO: Don't use basestring. Use Union[str, bytes] or AnyStr for arguments.
@@ -34,7 +34,7 @@ class _TemporaryFileWrapper(IO[str]):
delete = ... # type: bool
file = ... # type: IO
name = ... # type: Any
def __init__(self, file: IO, name, delete:bool = ...) -> None: ...
def __init__(self, file: IO, name, delete: bool = ...) -> None: ...
def __del__(self) -> None: ...
def __enter__(self) -> "_TemporaryFileWrapper": ...
def __exit__(self, exc, value, tb) -> bool: ...

View File

@@ -80,16 +80,16 @@ class Iterator(Iterable[_T_co], Generic[_T_co]):
class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def next(self) -> _T_co:...
def next(self) -> _T_co: ...
@abstractmethod
def send(self, value: _T_contra) -> _T_co:...
def send(self, value: _T_contra) -> _T_co: ...
@abstractmethod
def throw(self, typ: BaseException, val: Any = None, tb: Any = None) -> None:...
def throw(self, typ: BaseException, val: Any = None, tb: Any = None) -> None: ...
@abstractmethod
def close(self) -> None:...
def close(self) -> None: ...
class Container(Generic[_T_co]):
@abstractmethod
@@ -176,7 +176,7 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
class Mapping(Sized, Iterable[_KT], Container[_KT], Generic[_KT, _VT_co]):
# TODO: We wish the key type could also be covariant, but that doesn't work,
# see discussion in https://github.com/python/typing/pull/273.
# see discussion in https: //github.com/python/typing/pull/273.
@abstractmethod
def __getitem__(self, k: _KT) -> _VT_co:
...

View File

@@ -2,7 +2,7 @@
from typing import Any
def bench(obj: Any, name: str, n:int = ...) -> float: ...
def bench(obj: Any, name: str, n: int = ...) -> float: ...
class spamdict(dict):
state = ... # type: int

View File

@@ -8,27 +8,27 @@ pi = ... # type: float
_C = Union[float, complex]
def acos(x:_C) -> complex: ...
def acosh(x:_C) -> complex: ...
def asin(x:_C) -> complex: ...
def asinh(x:_C) -> complex: ...
def atan(x:_C) -> complex: ...
def atanh(x:_C) -> complex: ...
def cos(x:_C) -> complex: ...
def cosh(x:_C) -> complex: ...
def exp(x:_C) -> complex: ...
def isinf(z:_C) -> bool: ...
def isnan(z:_C) -> bool: ...
def log(x:_C, base:_C = ...) -> complex: ...
def log10(x:_C) -> complex: ...
def phase(z:_C) -> float: ...
def polar(z:_C) -> Tuple[float, float]: ...
def rect(r:float, phi:float) -> complex: ...
def sin(x:_C) -> complex: ...
def sinh(x:_C) -> complex: ...
def sqrt(x:_C) -> complex: ...
def tan(x:_C) -> complex: ...
def tanh(x:_C) -> complex: ...
def acos(x: _C) -> complex: ...
def acosh(x: _C) -> complex: ...
def asin(x: _C) -> complex: ...
def asinh(x: _C) -> complex: ...
def atan(x: _C) -> complex: ...
def atanh(x: _C) -> complex: ...
def cos(x: _C) -> complex: ...
def cosh(x: _C) -> complex: ...
def exp(x: _C) -> complex: ...
def isinf(z: _C) -> bool: ...
def isnan(z: _C) -> bool: ...
def log(x: _C, base: _C = ...) -> complex: ...
def log10(x: _C) -> complex: ...
def phase(z: _C) -> float: ...
def polar(z: _C) -> Tuple[float, float]: ...
def rect(r: float, phi: float) -> complex: ...
def sin(x: _C) -> complex: ...
def sinh(x: _C) -> complex: ...
def sqrt(x: _C) -> complex: ...
def tan(x: _C) -> complex: ...
def tanh(x: _C) -> complex: ...
if sys.version_info >= (3,):
def isfinite(z:_C) -> bool: ...
def isfinite(z: _C) -> bool: ...

View File

@@ -43,7 +43,7 @@ def __add__(a: Any, b: Any) -> Any: ...
def and_(a: Any, b: Any) -> Any: ...
def __and__(a: Any, b: Any) -> Any: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def div(a: Any, b: Any) -> Any: ...
def __div__(a: Any, b: Any) -> Any: ...
@@ -67,7 +67,7 @@ def __mod__(a: Any, b: Any) -> Any: ...
def mul(a: Any, b: Any) -> Any: ...
def __mul__(a: Any, b: Any) -> Any: ...
if sys.version_info >= (3,5):
if sys.version_info >= (3, 5):
def matmul(a: Any, b: Any) -> Any: ...
def __matmul__(a: Any, b: Any) -> Any: ...
@@ -112,7 +112,7 @@ def __delitem__(a: MutableSequence[_T], b: int) -> None: ...
@overload
def __delitem__(a: MutableMapping[_K, _V], b: _K) -> None: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def delslice(a: MutableSequence[Any], b: int, c: int) -> None: ...
def __delslice__(a: MutableSequence[Any], b: int, c: int) -> None: ...
@@ -125,17 +125,17 @@ def __getitem__(a: Sequence[_T], b: int) -> _T: ...
@overload
def __getitem__(a: Mapping[_K, _V], b: _K) -> _V: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def getslice(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ...
def __getslice__(a: Sequence[_T], b: int, c: int) -> Sequence[_T]: ...
def indexOf(a: Sequence[_T], b: _T) -> int: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def repeat(a: Any, b: int) -> Any: ...
def __repeat__(a: Any, b: int) -> Any: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def sequenceIncludes(a: Container[Any], b: Any) -> bool: ...
@overload
@@ -147,7 +147,7 @@ def __setitem__(a: MutableSequence[_T], b: int, c: _T) -> None: ...
@overload
def __setitem__(a: MutableMapping[_K, _V], b: _K, c: _V) -> None: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def setslice(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ...
def __setslice__(a: MutableSequence[_T], b: int, c: int, v: Sequence[_T]) -> None: ...
@@ -177,7 +177,7 @@ def __iand__(a: Any, b: Any) -> Any: ...
def iconcat(a: Any, b: Any) -> Any: ...
def __iconcat__(a: Any, b: Any) -> Any: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def idiv(a: Any, b: Any) -> Any: ...
def __idiv__(a: Any, b: Any) -> Any: ...
@@ -193,7 +193,7 @@ def __imod__(a: Any, b: Any) -> Any: ...
def imul(a: Any, b: Any) -> Any: ...
def __imul__(a: Any, b: Any) -> Any: ...
if sys.version_info >= (3,5):
if sys.version_info >= (3, 5):
def imatmul(a: Any, b: Any) -> Any: ...
def __imatmul__(a: Any, b: Any) -> Any: ...
@@ -203,7 +203,7 @@ def __ior__(a: Any, b: Any) -> Any: ...
def ipow(a: Any, b: Any) -> Any: ...
def __ipow__(a: Any, b: Any) -> Any: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def irepeat(a: Any, b: int) -> Any: ...
def __irepeat__(a: Any, b: int) -> Any: ...
@@ -220,7 +220,7 @@ def ixor(a: Any, b: Any) -> Any: ...
def __ixor__(a: Any, b: Any) -> Any: ...
if sys.version_info < (3,):
if sys.version_info < (3, ):
def isCallable(x: Any) -> bool: ...
def isMappingType(x: Any) -> bool: ...
def isNumberType(x: Any) -> bool: ...

View File

@@ -58,7 +58,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
@abstractmethod
def run_in_executor(self, executor: Any,
callback: Callable[[],Any], *args: Any) -> Future[Any]: ...
callback: Callable[[], Any], *args: Any) -> Future[Any]: ...
@abstractmethod
def set_default_executor(self, executor: Any) -> None: ...
# Network I/O methods returning Futures.
@@ -118,11 +118,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
#?? check Any
# return (Transport, Protocol)
@abstractmethod
def add_reader(self, fd: int, callback: Callable[[],Any], *args: List[Any]) -> None: ...
def add_reader(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_reader(self, fd: int) -> None: ...
@abstractmethod
def add_writer(self, fd: int, callback: Callable[[],Any], *args: List[Any]) -> None: ...
def add_writer(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_writer(self, fd: int) -> None: ...
# Completion based I/O methods returning Futures.
@@ -136,7 +136,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
def sock_accept(self, sock: Any) -> Any: ...
# Signal handling.
@abstractmethod
def add_signal_handler(self, sig: int, callback: Callable[[],Any], *args: List[Any]) -> None: ...
def add_signal_handler(self, sig: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_signal_handler(self, sig: int) -> None: ...
# Error handlers.

View File

@@ -20,7 +20,7 @@ class PurePath(_PurePathBase):
suffix = ... # type: str
suffixes = ... # type: List[str]
stem = ... # type: str
if sys.version_info < (3,5):
if sys.version_info < (3, 5):
def __init__(self, *pathsegments: str) -> None: ...
else:
def __new__(cls: Type[_P], *args: Union[str, PurePath]) -> _P: ...

View File

@@ -11,41 +11,41 @@ def register(search_function: Callable[[str], Any]) -> None: ...
def register_error(errors: str, handler: _Handler) -> None: ...
def lookup(a: str) -> codecs.CodecInfo: ...
def lookup_error(a: str) -> _Handler: ...
def decode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
def encode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
def decode(obj: Any, encoding: str = ..., errors: str = ...) -> Any: ...
def encode(obj: Any, encoding: str = ..., errors: str = ...) -> Any: ...
def charmap_build(a: str) -> Dict[int, int]: ...
def ascii_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def ascii_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def ascii_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def ascii_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def charbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def charmap_decode(data: AnyStr, errors: str = ..., mapping: Optional[Dict[int, int]] = ...) -> Tuple[str, int]: ...
def charmap_encode(data: AnyStr, errors: str, mapping: Optional[Dict[int, int]] = ...) -> Tuple[bytes, int]: ...
def escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def latin_1_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def latin_1_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def raw_unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def raw_unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def readbuffer_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def unicode_internal_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
def unicode_internal_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_16_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_16_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_32_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_32_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_32_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_32_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_7_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_7_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def utf_8_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
def utf_8_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
def escape_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def escape_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def latin_1_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def latin_1_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def raw_unicode_escape_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def raw_unicode_escape_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def readbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def unicode_escape_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def unicode_internal_decode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
def unicode_internal_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_be_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_16_ex_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_le_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_16_le_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_32_be_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_be_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_32_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_32_ex_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_le_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_32_le_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_7_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_7_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...
def utf_8_decode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[str, int]: ...
def utf_8_encode(data: AnyStr, errors: str = ..., final: int = ...) -> Tuple[bytes, int]: ...

View File

@@ -27,4 +27,4 @@ class make_scanner:
def __call__(self, string: str, index: int) -> Tuple[Any, int]: ...
def encode_basestring_ascii(s: str) -> str: ...
def scanstring(string: str, end: int, strict:bool = ...) -> Tuple[str, int]: ...
def scanstring(string: str, end: int, strict: bool = ...) -> Tuple[str, int]: ...

View File

@@ -4,8 +4,8 @@ _defaultaction = ... # type: str
_onceregistry = ... # type: dict
filters = ... # type: List[tuple]
def warn(message: Warning, category:type = ..., stacklevel:int = ...) -> None: ...
def warn_explicit(message: Warning, category:type,
def warn(message: Warning, category: type = ..., stacklevel: int = ...) -> None: ...
def warn_explicit(message: Warning, category: type,
filename: str, lineno: int,
module:Any = ..., registry:dict = ...,
module_globals:dict = ...) -> None: ...
module: Any = ..., registry: dict = ...,
module_globals: dict = ...) -> None: ...

View File

@@ -727,11 +727,11 @@ def map(func: Callable[[_T1, _T2], _S], iter1: Iterable[_T1],
@overload
def max(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def max(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default:_T = ...) -> _T: ...
def max(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default: _T = ...) -> _T: ...
@overload
def min(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
@overload
def min(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default:_T = ...) -> _T: ...
def min(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default: _T = ...) -> _T: ...
@overload
def next(i: Iterator[_T]) -> _T: ...
@overload

View File

@@ -1,5 +1,5 @@
from typing import Any
def getline(filename:str, lineno:int, module_globals: Any=...) -> str: pass
def getline(filename: str, lineno: int, module_globals: Any=...) -> str: pass
def clearcache() -> None: pass
def getlines(filename: str, module_globals: Any=...) -> None: pass

View File

@@ -1,7 +1,7 @@
# Stubs for os
# Ron Murawski <ron@horizonchess.com>
# based on http://docs.python.org/3.2/library/os.html
# based on http: //docs.python.org/3.2/library/os.html
from typing import (
Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr,
@@ -105,7 +105,7 @@ WNOHANG = 0 # Unix only
TMP_MAX = 0 # Undocumented, but used by tempfile
# ----- os classes (structures) -----
if sys.version_info >= (3,6):
if sys.version_info >= (3, 6):
class PathLike:
def __fspath__(self) -> AnyStr: ...

View File

@@ -98,41 +98,41 @@ class Iterator(Iterable[_T_co], Generic[_T_co]):
class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def __next__(self) -> _T_co:...
def __next__(self) -> _T_co: ...
@abstractmethod
def send(self, value: _T_contra) -> _T_co:...
def send(self, value: _T_contra) -> _T_co: ...
@abstractmethod
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = None,
# TODO: tb should be TracebackType but that's defined in types
tb: Any = None) -> None:...
tb: Any = None) -> None: ...
@abstractmethod
def close(self) -> None:...
def close(self) -> None: ...
@abstractmethod
def __iter__(self) -> 'Generator[_T_co, _T_contra, _V_co]': ...
# TODO: Several types should only be defined if sys.python_version >= (3, 5):
# Awaitable, AsyncIterator, AsyncIterable, Coroutine, Collection, ContextManager.
# See https://github.com/python/typeshed/issues/655 for why this is not easy.
# See https: //github.com/python/typeshed/issues/655 for why this is not easy.
class Awaitable(Generic[_T_co]):
@abstractmethod
def __await__(self) -> Generator[Any, None, _T_co]:...
def __await__(self) -> Generator[Any, None, _T_co]: ...
class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def send(self, value: _T_contra) -> _T_co:...
def send(self, value: _T_contra) -> _T_co: ...
@abstractmethod
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = None,
# TODO: tb should be TracebackType but that's defined in types
tb: Any = None) -> None:...
tb: Any = None) -> None: ...
@abstractmethod
def close(self) -> None:...
def close(self) -> None: ...
# NOTE: This type does not exist in typing.py or PEP 484.
@@ -143,13 +143,13 @@ class AwaitableGenerator(Generator[_T_co, _T_contra, _V_co], Awaitable[_V_co],
class AsyncIterable(Generic[_T_co]):
@abstractmethod
def __anext__(self) -> Awaitable[_T_co]:...
def __anext__(self) -> Awaitable[_T_co]: ...
class AsyncIterator(AsyncIterable[_T_co],
Generic[_T_co]):
@abstractmethod
def __anext__(self) -> Awaitable[_T_co]:...
def __aiter__(self) -> 'AsyncIterator[_T_co]':...
def __anext__(self) -> Awaitable[_T_co]: ...
def __aiter__(self) -> 'AsyncIterator[_T_co]': ...
class Container(Generic[_T_co]):
@abstractmethod
@@ -245,7 +245,7 @@ class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
class Mapping(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT_co]):
# TODO: We wish the key type could also be covariant, but that doesn't work,
# see discussion in https://github.com/python/typing/pull/273.
# see discussion in https: //github.com/python/typing/pull/273.
@abstractmethod
def __getitem__(self, k: _KT) -> _VT_co:
...

View File

@@ -86,7 +86,7 @@ class ParseResultBytes(_ParseResultBase[bytes], _NetlocResultMixinBytes): ...
def parse_qs(qs: str, keep_blank_values : bool = ..., strict_parsing : bool = ..., encoding : str = ..., errors: str = ...) -> Dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[str,str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ..., encoding: str = ..., errors: str = ...) -> List[Tuple[str, str]]: ...
@overload
def quote(string: str, safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...