mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 02:41:16 +08:00
Fixing flake8 E231 errors
This commit is contained in:
@@ -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:
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user