mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-06 03:23:23 +08:00
Update type of "throw" method of generators to reflect that it can return a value (#1672)
This commit is contained in:
committed by
Jelle Zijlstra
parent
9a10c74345
commit
0b721b7af5
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user