Use Generator instead of Iterator for 3rd-party context managers (#12481)

This commit is contained in:
Max Muoto
2024-08-12 07:26:18 -05:00
committed by GitHub
parent 0b6f15c2ff
commit 37807d753a
14 changed files with 22 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
import decimal
from _typeshed import Incomplete
from collections import OrderedDict
from collections.abc import Callable, Generator, Iterator, Sequence
from collections.abc import Callable, Generator, Sequence
from contextlib import contextmanager
from re import Pattern
from typing import Any, ClassVar, Literal, NamedTuple, TypeVar, overload
@@ -354,7 +354,7 @@ class PaintedPath:
@clipping_path.setter
def clipping_path(self, new_clipath) -> None: ...
@contextmanager
def transform_group(self, transform) -> Iterator[Self]: ...
def transform_group(self, transform) -> Generator[Self]: ...
def add_path_element(self, item, _copy: bool = True) -> None: ...
def remove_last_path_element(self) -> None: ...
def rectangle(self, x, y, w, h, rx: int = 0, ry: int = 0) -> Self: ...

View File

@@ -426,7 +426,7 @@ class FPDF(GraphicsStateMixin):
def skew(
self, ax: float = 0, ay: float = 0, x: float | None = None, y: float | None = None
) -> _GeneratorContextManager[None]: ...
def mirror(self, origin, angle) -> Generator[None, None, None]: ...
def mirror(self, origin, angle) -> Generator[None]: ...
def local_context(
self,
font_family: Incomplete | None = None,