From 0673b7bab93e200bfcf82df601e4cb394f9dca37 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 11 Jan 2016 15:26:22 -0800 Subject: [PATCH] Add Generator to 2.7/typing.pyi. Fixes #29. --- stdlib/2.7/typing.pyi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stdlib/2.7/typing.pyi b/stdlib/2.7/typing.pyi index a0538b0a2..f29c48254 100644 --- a/stdlib/2.7/typing.pyi +++ b/stdlib/2.7/typing.pyi @@ -76,6 +76,19 @@ class Iterator(Iterable[_T_co], Generic[_T_co]): @abstractmethod def next(self) -> _T_co: ... +class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]): + @abstractmethod + def next(self) -> _T_co:... + + @abstractmethod + def send(self, value: _T_contra) -> _T_co:... + + @abstractmethod + def throw(self, typ: BaseException, val: Any=None, tb=None) -> None:... + + @abstractmethod + def close(self) -> None:... + class Container(Generic[_T_co]): @abstractmethod def __contains__(self, x: object) -> bool: ...