Added missing attributes of typing.Generator and typing.AsyncGenerator (#886)

This commit is contained in:
Andrey Vlasovskikh
2017-03-29 20:09:24 +02:00
committed by Guido van Rossum
parent 72d275bbf5
commit 8b26422b95
2 changed files with 17 additions and 1 deletions

View File

@@ -1,8 +1,9 @@
# Stubs for typing (Python 2.7)
from abc import abstractmethod, ABCMeta
from types import CodeType, FrameType
# Definitions of special type checking related constructs. Their definition
# Definitions of special type checking related constructs. Their definitions
# are not used, so their value does not matter.
overload = object()
@@ -109,6 +110,10 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def close(self) -> None: ...
gi_code = ... # type: CodeType
gi_frame = ... # type: FrameType
gi_running = ... # type: bool
class Container(Generic[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...