mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 01:53:24 +08:00
Fixing flake8 E261 errors
This commit is contained in:
@@ -94,4 +94,4 @@ DefaultEventLoopPolicy = ... # type: Type[AbstractEventLoopPolicy]
|
||||
|
||||
# TODO: AbstractChildWatcher (UNIX only)
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any, Callable, Generator, TypeVar
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
_F = TypeVar('_F', bound=Callable[..., Any])
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from abc import ABCMeta, abstractmethod
|
||||
from asyncio.futures import Future
|
||||
from asyncio.coroutines import coroutine
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -14,7 +14,7 @@ AI_PASSIVE = 0
|
||||
|
||||
class Handle:
|
||||
_cancelled = False
|
||||
_args = ... # type: List[Any]
|
||||
_args = ... # type: List[Any]
|
||||
def __init__(self, callback: Callable[..., Any], args: List[Any],
|
||||
loop: AbstractEventLoop) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
@@ -30,7 +30,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def run_forever(self) -> None: ...
|
||||
|
||||
# Can't use a union, see mypy issue #1873.
|
||||
# Can't use a union, see mypy issue #1873.
|
||||
@overload
|
||||
@abstractmethod
|
||||
def run_until_complete(self, future: Generator[Any, Any, _T]) -> _T: ...
|
||||
@@ -127,11 +127,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
def remove_writer(self, fd: int) -> None: ...
|
||||
# Completion based I/O methods returning Futures.
|
||||
@abstractmethod
|
||||
def sock_recv(self, sock: Any, nbytes: int) -> Any: ... #TODO
|
||||
def sock_recv(self, sock: Any, nbytes: int) -> Any: ... #TODO
|
||||
@abstractmethod
|
||||
def sock_sendall(self, sock: Any, data: bytes) -> None: ... #TODO
|
||||
def sock_sendall(self, sock: Any, data: bytes) -> None: ... #TODO
|
||||
@abstractmethod
|
||||
def sock_connect(self, sock: Any, address: str) -> Any: ... #TODO
|
||||
def sock_connect(self, sock: Any, address: str) -> Any: ... #TODO
|
||||
@abstractmethod
|
||||
def sock_accept(self, sock: Any) -> Any: ...
|
||||
# Signal handling.
|
||||
@@ -163,7 +163,7 @@ class AbstractEventLoopPolicy(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def get_child_watcher(self) -> Any: ... # TODO: unix_events.AbstractChildWatcher
|
||||
@abstractmethod
|
||||
def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher
|
||||
def set_child_watcher(self, watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher
|
||||
|
||||
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
|
||||
def __init__(self) -> None: ...
|
||||
@@ -179,4 +179,4 @@ def set_event_loop(loop: AbstractEventLoop) -> None: ...
|
||||
def new_event_loop() -> AbstractEventLoop: ...
|
||||
|
||||
def get_child_watcher() -> Any: ... # TODO: unix_events.AbstractChildWatcher
|
||||
def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher
|
||||
def set_child_watcher(watcher: Any) -> None: ... # TODO: unix_events.AbstractChildWatcher
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from typing import Any, Union, Callable, TypeVar, List, Generic, Iterable, Generator, Awaitable
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -16,7 +16,7 @@ class InvalidStateError(Error): ...
|
||||
|
||||
class _TracebackLogger:
|
||||
exc = ... # type: BaseException
|
||||
tb = ... # type: List[str]
|
||||
tb = ... # type: List[str]
|
||||
def __init__(self, exc: Any, loop: AbstractEventLoop) -> None: ...
|
||||
def activate(self) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -24,7 +24,7 @@ class _TracebackLogger:
|
||||
|
||||
class Future(Iterable[_T], Awaitable[_T], Generic[_T]):
|
||||
_state = ... # type: str
|
||||
_exception = ... # type: BaseException
|
||||
_exception = ... # type: BaseException
|
||||
_blocking = False
|
||||
_log_traceback = False
|
||||
_tb_logger = _TracebackLogger
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import AnyStr
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
from asyncio import transports
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import TypeVar, Generic
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from .coroutines import coroutine
|
||||
|
||||
@@ -8,7 +8,7 @@ from . import events
|
||||
from . import protocols
|
||||
from . import transports
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
class IncompleteReadError(EOFError):
|
||||
def __init__(self, partial: str, expected: int) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Any, AnyStr, Tuple, Union
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
from asyncio import events
|
||||
from asyncio import protocols
|
||||
@@ -9,9 +9,9 @@ from asyncio import transports
|
||||
from asyncio.coroutines import coroutine
|
||||
|
||||
|
||||
PIPE = ... # type: int
|
||||
STDOUT = ... # type: int
|
||||
DEVNULL = ... # type: int
|
||||
PIPE = ... # type: int
|
||||
STDOUT = ... # type: int
|
||||
DEVNULL = ... # type: int
|
||||
|
||||
class SubprocessStreamProtocol(streams.FlowControlMixin,
|
||||
protocols.SubprocessProtocol):
|
||||
@@ -40,7 +40,7 @@ class Process:
|
||||
|
||||
@coroutine
|
||||
def create_subprocess_shell(
|
||||
*Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
|
||||
*Args: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
|
||||
stdin: int = ...,
|
||||
stdout: int = ...,
|
||||
stderr: int = ...,
|
||||
@@ -50,7 +50,7 @@ def create_subprocess_shell(
|
||||
|
||||
@coroutine
|
||||
def create_subprocess_exec(
|
||||
program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
|
||||
program: Union[str, bytes], # Union used instead of AnyStr due to mypy issue #1236
|
||||
*args: Any,
|
||||
stdin: int = ...,
|
||||
stdout: int = ...,
|
||||
|
||||
@@ -3,7 +3,7 @@ from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic
|
||||
Optional)
|
||||
import concurrent.futures
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
from .futures import Future
|
||||
@@ -41,7 +41,7 @@ class Task(Future[_T], Generic[_T]):
|
||||
@classmethod
|
||||
def all_tasks(cls, loop: AbstractEventLoop = ...) -> Set[Task]: ...
|
||||
|
||||
# Can't use a union, see mypy issue #1873.
|
||||
# Can't use a union, see mypy issue #1873.
|
||||
@overload
|
||||
def __init__(self, coro: Generator[Any, None, _T],
|
||||
*, loop: AbstractEventLoop = ...) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Dict, Any, TypeVar, Mapping, List
|
||||
|
||||
__all__ = ... # type: str
|
||||
__all__ = ... # type: str
|
||||
|
||||
class BaseTransport:
|
||||
def __init__(self, extra: Mapping[Any, Any] = ...) -> None: ...
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
from typing import Union, Optional, Callable
|
||||
from .ElementTree import Element
|
||||
|
||||
XINCLUDE = ... # type: str
|
||||
XINCLUDE_INCLUDE = ... # type: str
|
||||
XINCLUDE_FALLBACK = ... # type: str
|
||||
XINCLUDE = ... # type: str
|
||||
XINCLUDE_INCLUDE = ... # type: str
|
||||
XINCLUDE_FALLBACK = ... # type: str
|
||||
|
||||
class FatalIncludeError(SyntaxError): ...
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
|
||||
from .ElementTree import Element
|
||||
|
||||
xpath_tokenizer_re = ... # type: Pattern
|
||||
xpath_tokenizer_re = ... # type: Pattern
|
||||
|
||||
_token = Tuple[str, str]
|
||||
_next = Callable[[], _token]
|
||||
@@ -20,11 +20,11 @@ def prepare_descendant(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_parent(next: _next, token: _token) -> _callback: ...
|
||||
def prepare_predicate(next: _next, token: _token) -> _callback: ...
|
||||
|
||||
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
|
||||
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
|
||||
|
||||
class _SelectorContext:
|
||||
parent_map = ... # type: Dict[Element, Element]
|
||||
root = ... # type: Element
|
||||
parent_map = ... # type: Dict[Element, Element]
|
||||
root = ... # type: Element
|
||||
def __init__(self, root: Element) -> None: ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
|
||||
import io
|
||||
|
||||
VERSION = ... # type: str
|
||||
VERSION = ... # type: str
|
||||
|
||||
class ParseError(SyntaxError): ...
|
||||
|
||||
@@ -16,10 +16,10 @@ _T = TypeVar('_T')
|
||||
_str_or_bytes = Union[str, bytes]
|
||||
|
||||
class Element(Sequence['Element']):
|
||||
tag = ... # type: _str_or_bytes
|
||||
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
|
||||
text = ... # type: Optional[_str_or_bytes]
|
||||
tail = ... # type: Optional[_str_or_bytes]
|
||||
tag = ... # type: _str_or_bytes
|
||||
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
|
||||
text = ... # type: Optional[_str_or_bytes]
|
||||
tail = ... # type: Optional[_str_or_bytes]
|
||||
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> None: ...
|
||||
def append(self, subelement: 'Element') -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -50,10 +50,10 @@ def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., *
|
||||
def Comment(text: _str_or_bytes=...) -> Element: ...
|
||||
def ProcessingInstruction(target: str, text: str=...) -> Element: ...
|
||||
|
||||
PI = ... # type: Callable[..., Element]
|
||||
PI = ... # type: Callable[..., Element]
|
||||
|
||||
class QName:
|
||||
text = ... # type: str
|
||||
text = ... # type: str
|
||||
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class XMLPullParser:
|
||||
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
|
||||
|
||||
class _IterParseIterator:
|
||||
root = ... # type: Any
|
||||
root = ... # type: Any
|
||||
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
|
||||
def __next__(self) -> Tuple[str, Element]: ...
|
||||
def __iter__(self) -> _IterParseIterator: ...
|
||||
@@ -95,7 +95,7 @@ def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
|
||||
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
|
||||
|
||||
# TODO-improve this type
|
||||
fromstring = ... # type: Callable[..., Element]
|
||||
fromstring = ... # type: Callable[..., Element]
|
||||
|
||||
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
|
||||
|
||||
@@ -107,11 +107,11 @@ class TreeBuilder:
|
||||
def end(self, tag: AnyStr) -> Element: ...
|
||||
|
||||
class XMLParser:
|
||||
parser = ... # type: Any
|
||||
target = ... # type: TreeBuilder
|
||||
parser = ... # type: Any
|
||||
target = ... # type: TreeBuilder
|
||||
# TODO-what is entity used for???
|
||||
entity = ... # type: Any
|
||||
version = ... # type: str
|
||||
entity = ... # type: Any
|
||||
version = ... # type: str
|
||||
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
|
||||
def doctype(self, name: str, pubid: str, system: str) -> None: ...
|
||||
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
|
||||
|
||||
Reference in New Issue
Block a user