mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fixing flake8 E111, E114, E116, E203, E225, E262 errors
This commit is contained in:
4
.flake8
4
.flake8
@@ -18,11 +18,7 @@ ignore = F401, F811, E127, E128, E301, E302, E305, E501, E701, E704, B303
|
||||
|
||||
# Errors that we need to fix before enabling flake8 by default:
|
||||
# 921 F821 undefined name
|
||||
# 28 E116 unexpected indentation (comment)
|
||||
# 26 F403 from * import used
|
||||
# 14 E251 unexpected spaces around keyword argument '='
|
||||
# 7 E999 invalid syntax
|
||||
# 7 E111 indentation is not a multiple of four
|
||||
# 5 F405 name undefined or from * imports
|
||||
# 4 E262 inline comment should start with #
|
||||
# 4 E114 indentation is not a multiple of four
|
||||
|
||||
@@ -3,10 +3,10 @@ from typing import Any, Callable, Generic, Optional, TypeVar
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class CallableProxyType(object): # "weakcallableproxy"
|
||||
pass
|
||||
pass
|
||||
|
||||
class ProxyType(object): # "weakproxy"
|
||||
pass
|
||||
pass
|
||||
|
||||
class ReferenceType(Generic[_T]):
|
||||
# TODO rest of members
|
||||
|
||||
@@ -19,7 +19,7 @@ class Random(_random.Random):
|
||||
def seed(self, x: object = ...) -> None: ...
|
||||
def getstate(self) -> _random._State: ...
|
||||
def setstate(self, state: _random._State) -> None: ...
|
||||
def jumpahead(self, n : int) -> None: ...
|
||||
def jumpahead(self, n: int) -> None: ...
|
||||
def getrandbits(self, k: int) -> int: ...
|
||||
@overload
|
||||
def randrange(self, stop: int) -> int: ...
|
||||
@@ -51,7 +51,7 @@ class SystemRandom(Random):
|
||||
def seed(x: object = ...) -> None: ...
|
||||
def getstate() -> object: ...
|
||||
def setstate(state: object) -> None: ...
|
||||
def jumpahead(n : int) -> None: ...
|
||||
def jumpahead(n: int) -> None: ...
|
||||
def getrandbits(k: int) -> int: ...
|
||||
@overload
|
||||
def randrange(stop: int) -> int: ...
|
||||
|
||||
@@ -30,7 +30,7 @@ class Request(object):
|
||||
def get_type(self): ...
|
||||
def get_host(self) -> str: ...
|
||||
def get_selector(self): ...
|
||||
def set_proxy(self, host, type)-> None: ...
|
||||
def set_proxy(self, host, type) -> None: ...
|
||||
def has_proxy(self) -> bool: ...
|
||||
def get_origin_req_host(self) -> str: ...
|
||||
def is_unverifiable(self) -> bool: ...
|
||||
@@ -156,5 +156,5 @@ class CacheFTPHandler(FTPHandler):
|
||||
def check_cache(self): ...
|
||||
def clear_cache(self): ...
|
||||
|
||||
def parse_http_list(s: AnyStr) -> List[AnyStr] : ...
|
||||
def parse_http_list(s: AnyStr) -> List[AnyStr]: ...
|
||||
def parse_keqv_list(l: List[AnyStr]) -> Dict[AnyStr, AnyStr]: ...
|
||||
|
||||
@@ -71,52 +71,34 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
def create_connection(self, protocol_factory: Any, host: str = ..., port: int = ..., *,
|
||||
ssl: Any = ..., family: int = ..., proto: int = ..., flags: int = ..., sock: Any = ...,
|
||||
local_addr: str = ..., server_hostname: str = ...) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def create_server(self, protocol_factory: Any, host: str = ..., port: int = ..., *,
|
||||
family: int = ..., flags: int = ...,
|
||||
sock: Any = ..., backlog: int = ..., ssl: Any = ..., reuse_address: Any = ...) -> Any: ...
|
||||
# ?? check Any
|
||||
# return Server
|
||||
@abstractmethod
|
||||
def create_unix_connection(self, protocol_factory: Any, path: str, *,
|
||||
ssl: Any = ..., sock: Any = ...,
|
||||
server_hostname: str = ...) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return tuple(Transport, Protocol)
|
||||
@abstractmethod
|
||||
def create_unix_server(self, protocol_factory: Any, path: str, *,
|
||||
sock: Any = ..., backlog: int = ..., ssl: Any = ...) -> Any: ...
|
||||
# ?? check Any
|
||||
# return Server
|
||||
@abstractmethod
|
||||
def create_datagram_endpoint(self, protocol_factory: Any,
|
||||
local_addr: str = ..., remote_addr: str = ..., *,
|
||||
family: int = ..., proto: int = ..., flags: int = ...) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
# Pipes and subprocesses.
|
||||
@abstractmethod
|
||||
def connect_read_pipe(self, protocol_factory: Any, pipe: Any) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def connect_write_pipe(self, protocol_factory: Any, pipe: Any) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def subprocess_shell(self, protocol_factory: Any, cmd: Union[bytes, str], *, stdin: Any = ...,
|
||||
stdout: Any = ..., stderr: Any = ...,
|
||||
**kwargs: Any) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def subprocess_exec(self, protocol_factory: Any, *args: List[Any], stdin: Any = ...,
|
||||
stdout: Any = ..., stderr: Any = ...,
|
||||
**kwargs: Any) -> tuple: ...
|
||||
# ?? check Any
|
||||
# return (Transport, Protocol)
|
||||
@abstractmethod
|
||||
def add_reader(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
|
||||
@abstractmethod
|
||||
|
||||
@@ -12,7 +12,8 @@ if sys.version_info >= (3, 4):
|
||||
|
||||
_Path = Union[bytes, str]
|
||||
|
||||
class Finder(metaclass=ABCMeta): ...
|
||||
class Finder(metaclass=ABCMeta):
|
||||
...
|
||||
# Technically this class defines the following method, but its subclasses
|
||||
# in this module violate its signature. Since this class is deprecated, it's
|
||||
# easier to simply ignore that this method exists.
|
||||
|
||||
@@ -141,14 +141,12 @@ class stat_result:
|
||||
st_size = 0 # size of file, in bytes,
|
||||
st_atime = 0.0 # time of most recent access,
|
||||
st_mtime = 0.0 # time of most recent content modification,
|
||||
st_ctime = 0.0 # platform dependent (time of most recent metadata change
|
||||
# on Unix, or the time of creation on Windows)
|
||||
st_ctime = 0.0 # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows)
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
st_atime_ns = 0 # time of most recent access, in nanoseconds
|
||||
st_mtime_ns = 0 # time of most recent content modification in nanoseconds
|
||||
st_ctime_ns = 0 # platform dependent (time of most recent metadata change
|
||||
# on Unix, or the time of creation on Windows) in nanoseconds
|
||||
st_ctime_ns = 0 # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds
|
||||
|
||||
# not documented
|
||||
def __init__(self, tuple: Tuple[int, ...]) -> None: ...
|
||||
@@ -185,7 +183,7 @@ class statvfs_result: # Unix only
|
||||
# ----- os function stubs -----
|
||||
def fsencode(filename: str) -> bytes: ...
|
||||
def fsdecode(filename: bytes) -> str: ...
|
||||
def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str] : ...
|
||||
def get_exec_path(env: Optional[Mapping[str, str]] = ...) -> List[str]: ...
|
||||
# NOTE: get_exec_path(): returns List[bytes] when env not None
|
||||
def ctermid() -> str: ... # Unix only
|
||||
def getegid() -> int: ... # Unix only
|
||||
|
||||
@@ -29,7 +29,7 @@ def move(src: str, dst: str) -> None: ...
|
||||
|
||||
class Error(Exception): ...
|
||||
if sys.version_info >= (3, 4):
|
||||
class SameFileError(Error): ...
|
||||
class SameFileError(Error): ...
|
||||
|
||||
def make_archive(base_name: str, format: str, root_dir: str = ...,
|
||||
base_dir: str = ..., verbose: bool = ...,
|
||||
|
||||
@@ -64,8 +64,8 @@ UF_APPEND = 0
|
||||
UF_OPAQUE = 0
|
||||
UF_NOUNLINK = 0
|
||||
if sys.platform == 'darwin':
|
||||
UF_COMPRESSED = 0 # OS X 10.6+ only
|
||||
UF_HIDDEN = 0 # OX X 10.5+ only
|
||||
UF_COMPRESSED = 0 # OS X 10.6+ only
|
||||
UF_HIDDEN = 0 # OX X 10.5+ only
|
||||
SF_ARCHIVED = 0
|
||||
SF_IMMUTABLE = 0
|
||||
SF_APPEND = 0
|
||||
|
||||
@@ -96,9 +96,7 @@ class _hash_info:
|
||||
|
||||
int_info = ... # type: _int_info
|
||||
class _int_info:
|
||||
bits_per_digit = 0 # number of bits held in each digit. Python integers
|
||||
# are stored internally in
|
||||
# base 2**int_info.bits_per_digit
|
||||
bits_per_digit = 0 # number of bits held in each digit. Python integers are stored internally in base 2**int_info.bits_per_digit
|
||||
sizeof_digit = 0 # size in bytes of C type used to represent a digit
|
||||
|
||||
class _version_info(Tuple[int, int, int, str, int]):
|
||||
|
||||
@@ -84,7 +84,7 @@ class SplitResultBytes(_SplitResultBase[bytes], _NetlocResultMixinBytes): ...
|
||||
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_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]]: ...
|
||||
|
||||
|
||||
4
third_party/2/gflags.pyi
vendored
4
third_party/2/gflags.pyi
vendored
@@ -10,7 +10,7 @@ class CantOpenFlagFileError(FlagsError): ...
|
||||
class DuplicateFlagCannotPropagateNoneToSwig(DuplicateFlag): ...
|
||||
|
||||
class DuplicateFlagError(DuplicateFlag):
|
||||
def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ...
|
||||
def __init__(self, flagname: str, flag_values: FlagValues, other_flag_values: FlagValues = ...) -> None: ...
|
||||
|
||||
class IllegalFlagValue(FlagsError): ...
|
||||
|
||||
@@ -61,7 +61,7 @@ class FlagValues:
|
||||
def FlagsIntoString(self) -> str: ...
|
||||
def AppendFlagsIntoFile(self, filename: str) -> None: ...
|
||||
def WriteHelpInXMLFormat(self, outfile: IO[str] = ...) -> None: ...
|
||||
# TODO validator: gflags_validators.Validator
|
||||
# TODO validator: gflags_validators.Validator
|
||||
def AddValidator(self, validator: Any) -> None: ...
|
||||
|
||||
FLAGS = ... # type: FlagValues
|
||||
|
||||
Reference in New Issue
Block a user