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:
Sebastian Rittau
2018-10-24 16:20:53 +02:00
committed by Jelle Zijlstra
parent f362cf47fa
commit 006a79220f
83 changed files with 567 additions and 547 deletions

View File

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

View File

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

View File

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

View File

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