Update type of "throw" method of generators to reflect that it can return a value (#1672)

This commit is contained in:
Matthew Wright
2017-10-25 13:54:18 -07:00
committed by Jelle Zijlstra
parent 9a10c74345
commit 0b721b7af5
2 changed files with 3 additions and 3 deletions

View File

@@ -115,7 +115,7 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_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) -> _T_co: ...
@abstractmethod
def close(self) -> None: ...

View File

@@ -122,7 +122,7 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ...,
tb: Optional[TracebackType] = ...) -> None: ...
tb: Optional[TracebackType] = ...) -> _T_co: ...
@abstractmethod
def close(self) -> None: ...
@@ -149,7 +149,7 @@ class Coroutine(Awaitable[_V_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def throw(self, typ: Type[BaseException], val: Optional[BaseException] = ...,
tb: Optional[TracebackType] = ...) -> None: ...
tb: Optional[TracebackType] = ...) -> _T_co: ...
@abstractmethod
def close(self) -> None: ...