Update return type of Generator.close in 3.13 (#13127)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Brian SchubertandJelle Zijlstra authored and GitHub committed 2024-11-26 13:32:07 -08:00
1 parent 02533d13ea
commit 693add9512
1 file changed
+5 -1
+5 -1
View File
@@ -463,7 +463,11 @@ class Generator(Iterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra, _Return
@overload
@abstractmethod
def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ...
def close(self) -> None: ...
if sys.version_info >= (3, 13):
def close(self) -> _ReturnT_co | None: ...
else:
def close(self) -> None: ...
def __iter__(self) -> Generator[_YieldT_co, _SendT_contra, _ReturnT_co]: ...
@property
def gi_code(self) -> CodeType: ...