Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stdlib/3/collections/__init__.pyi
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
# TODO more abstract base classes (interfaces in mypy)

# These are not exported.
import sys
from typing import (
TypeVar, Generic, Dict, overload, List, Tuple,
Callable, Any, Type, Optional, Union
@@ -35,6 +36,8 @@ from typing import (
MutableSet as MutableSet,
AbstractSet as Set,
)
if sys.version_info >= (3, 6):
from typing import AsyncGenerator as AsyncGenerator

_T = TypeVar('_T')
_KT = TypeVar('_KT')
1 change: 1 addition & 0 deletions stdlib/3/collections/abc.pyi
Original file line number Diff line number Diff line change
@@ -35,4 +35,5 @@ if sys.version_info >= (3, 5):
if sys.version_info >= (3, 6):
from . import (
Reversible as Reversible,
AsyncGenerator as AsyncGenerator,
)
18 changes: 18 additions & 0 deletions stdlib/3/typing.pyi
Original file line number Diff line number Diff line change
@@ -151,6 +151,24 @@ class AsyncIterator(AsyncIterable[_T_co],
def __anext__(self) -> Awaitable[_T_co]: ...
def __aiter__(self) -> 'AsyncIterator[_T_co]': ...

if sys.version_info >= (3, 6):
class AsyncGenerator(AsyncIterator[_T_co], Generic[_T_co, _T_contra]):
@abstractmethod
def __anext__(self) -> Awaitable[_T_co]: ...

@abstractmethod
def asend(self, value: _T_contra) -> Awaitable[_T_co]: ...

@abstractmethod
def athrow(self, typ: Type[BaseException], val: Optional[BaseException] = None,
tb: Any = None) -> Awaitable[None]: ...

@abstractmethod
def aclose(self) -> Awaitable[None]: ...

@abstractmethod
def __aiter__(self) -> 'AsyncGenerator[_T_co, _T_contra]': ...

class Container(Generic[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...