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 Schubert
2024-11-26 16:32:07 -05:00
committed by GitHub
parent 02533d13ea
commit 693add9512

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: ...