diff --git a/stubs/fpdf2/fpdf/drawing.pyi b/stubs/fpdf2/fpdf/drawing.pyi index 997f1fd4f096..f9a426344f0e 100644 --- a/stubs/fpdf2/fpdf/drawing.pyi +++ b/stubs/fpdf2/fpdf/drawing.pyi @@ -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: ... diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index f364de98183c..0664638d0513 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -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, diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi index 8b7e65d98f29..d5893fc73ca6 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/client.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator from contextlib import contextmanager from typing import ClassVar @@ -32,4 +32,4 @@ class Client: global_cache_policy: Callable[[key.Key], bool] | None = ..., global_cache_timeout_policy: Callable[[key.Key], int] | None = ..., legacy_data: bool = ..., - ) -> Iterator[context_module.Context]: ... + ) -> Generator[context_module.Context]: ... diff --git a/stubs/jsonschema/jsonschema/validators.pyi b/stubs/jsonschema/jsonschema/validators.pyi index 72ef1f6cfcbe..a6f39402fcdc 100644 --- a/stubs/jsonschema/jsonschema/validators.pyi +++ b/stubs/jsonschema/jsonschema/validators.pyi @@ -107,7 +107,7 @@ class RefResolver: @property def base_uri(self): ... @contextmanager - def in_scope(self, scope) -> Generator[None, None, None]: ... + def in_scope(self, scope) -> Generator[None]: ... @contextmanager def resolving(self, ref) -> Generator[Incomplete, None, None]: ... def resolve(self, ref): ... diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index a03db334ffb5..1022522ad016 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -98,7 +98,7 @@ class Context: def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def push_alias(self) -> Generator[None, None, None]: ... + def push_alias(self) -> Generator[None]: ... def sql(self, obj): ... def literal(self, keyword): ... def value(self, value, converter: Incomplete | None = ..., add_param: bool = ...): ... diff --git a/stubs/pyflakes/pyflakes/checker.pyi b/stubs/pyflakes/pyflakes/checker.pyi index 4a18d8d70327..0d60f10dcd35 100644 --- a/stubs/pyflakes/pyflakes/checker.pyi +++ b/stubs/pyflakes/pyflakes/checker.pyi @@ -1,6 +1,6 @@ import ast import sys -from collections.abc import Callable, Iterable, Iterator +from collections.abc import Callable, Generator, Iterable, Iterator from contextlib import contextmanager from re import Pattern from typing import Any, ClassVar, Literal, TypeVar, overload @@ -203,7 +203,7 @@ class Checker: @property def scope(self) -> Scope: ... @contextmanager - def in_scope(self, cls: Callable[[], Scope]) -> Iterator[None]: ... + def in_scope(self, cls: Callable[[], Scope]) -> Generator[None]: ... def checkDeadScopes(self) -> None: ... def report(self, messageClass: Callable[_P, Message], *args: _P.args, **kwargs: _P.kwargs) -> None: ... def getParent(self, node: ast.AST) -> ast.AST: ... diff --git a/stubs/pygit2/pygit2/utils.pyi b/stubs/pygit2/pygit2/utils.pyi index 5fee3112f269..5bffb9cd2ff0 100644 --- a/stubs/pygit2/pygit2/utils.pyi +++ b/stubs/pygit2/pygit2/utils.pyi @@ -1,7 +1,7 @@ import contextlib import types from _typeshed import StrOrBytesPath, StrPath -from collections.abc import Iterator +from collections.abc import Generator from typing import Generic, TypeVar from typing_extensions import TypeAlias @@ -12,7 +12,7 @@ def to_bytes(s: _CDataBase | StrOrBytesPath | None, encoding: str = "utf-8", err def to_str(s: StrOrBytesPath) -> str: ... def ptr_to_bytes(ptr_cdata: _CDataBase) -> bytes: ... @contextlib.contextmanager -def new_git_strarray() -> Iterator[_GitStrArray]: ... +def new_git_strarray() -> Generator[_GitStrArray]: ... def strarray_to_strings(arr: _GitStrArray) -> list[str]: ... # Actual type: _cffi_backend.__CDataOwn diff --git a/stubs/pynput/pynput/keyboard/_base.pyi b/stubs/pynput/pynput/keyboard/_base.pyi index 69cc5cad0a4d..60eb21d285f0 100644 --- a/stubs/pynput/pynput/keyboard/_base.pyi +++ b/stubs/pynput/pynput/keyboard/_base.pyi @@ -1,7 +1,7 @@ import contextlib import enum import sys -from collections.abc import Callable, Iterable, Iterator +from collections.abc import Callable, Generator, Iterable, Iterator from typing import Any, ClassVar from typing_extensions import Self @@ -108,7 +108,7 @@ class Controller: def tap(self, key: str | Key | KeyCode) -> None: ... def touch(self, key: str | Key | KeyCode, is_press: bool) -> None: ... @contextlib.contextmanager - def pressed(self, *args: str | Key | KeyCode) -> Iterator[None]: ... + def pressed(self, *args: str | Key | KeyCode) -> Generator[None]: ... def type(self, string: str) -> None: ... @property def modifiers(self) -> contextlib.AbstractContextManager[Iterator[set[Key]]]: ... diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index e2398daeb417..d5574f604fc8 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -46,7 +46,7 @@ class PairSpec(TypedDict, total=False): wrap: int | None @contextmanager -def theme_context(params: dict[str, Any]) -> Generator[None, None, None]: ... +def theme_context(params: dict[str, Any]) -> Generator[None]: ... def build_plot_signature(cls: _ClsT) -> _ClsT: ... # -> _ClsT & "__signature__ protocol" class ThemeConfig(mpl.RcParams): diff --git a/stubs/setuptools/setuptools/wheel.pyi b/stubs/setuptools/setuptools/wheel.pyi index eeb7eee24b54..39cdfb84d1c5 100644 --- a/stubs/setuptools/setuptools/wheel.pyi +++ b/stubs/setuptools/setuptools/wheel.pyi @@ -5,7 +5,7 @@ WHEEL_NAME: Any NAMESPACE_PACKAGE_INIT: str def unpack(src_dir, dst_dir) -> None: ... -def disable_info_traces() -> Generator[None, None, None]: ... +def disable_info_traces() -> Generator[None]: ... class Wheel: filename: Any diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index f0b2e540226e..21c8df673cbd 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -2,7 +2,7 @@ import abc from _typeshed import Incomplete, Unused from abc import ABC, ABCMeta, abstractmethod from builtins import bool as _bool -from collections.abc import Callable, Iterable, Iterator, Sequence +from collections.abc import Callable, Generator, Iterable, Iterator, Sequence from contextlib import contextmanager from enum import Enum from types import TracebackType @@ -228,7 +228,7 @@ class Graph: def add_to_collection(self, name: str, value: object) -> None: ... def add_to_collections(self, names: Iterable[str] | str, value: object) -> None: ... @contextmanager - def as_default(self) -> Iterator[Self]: ... + def as_default(self) -> Generator[Self]: ... def finalize(self) -> None: ... def get_tensor_by_name(self, name: str) -> Tensor: ... def get_operation_by_name(self, name: str) -> Operation: ... diff --git a/stubs/tensorflow/tensorflow/autodiff.pyi b/stubs/tensorflow/tensorflow/autodiff.pyi index 61077d6f1309..47f5e1bb911c 100644 --- a/stubs/tensorflow/tensorflow/autodiff.pyi +++ b/stubs/tensorflow/tensorflow/autodiff.pyi @@ -56,7 +56,7 @@ class GradientTape: unconnected_gradients: UnconnectedGradients = ..., ) -> ContainerGradients: ... @contextmanager - def stop_recording(self) -> Generator[None, None, None]: ... + def stop_recording(self) -> Generator[None]: ... def reset(self) -> None: ... def watch(self, tensor: ContainerTensorsLike) -> None: ... def watched_variables(self) -> tuple[Variable, ...]: ... diff --git a/stubs/tensorflow/tensorflow/summary.pyi b/stubs/tensorflow/tensorflow/summary.pyi index bbfe02be2436..70d9fb784b7b 100644 --- a/stubs/tensorflow/tensorflow/summary.pyi +++ b/stubs/tensorflow/tensorflow/summary.pyi @@ -1,6 +1,6 @@ import abc from _typeshed import Incomplete -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator from contextlib import AbstractContextManager, contextmanager from typing import Literal from typing_extensions import Self @@ -49,7 +49,7 @@ def image( description: str | None = None, ) -> bool: ... @contextmanager -def record_if(condition: bool | tf.Tensor | Callable[[], bool]) -> Iterator[None]: ... +def record_if(condition: bool | tf.Tensor | Callable[[], bool]) -> Generator[None]: ... def scalar(name: str, data: float | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... def should_record_summaries() -> bool: ... def text(name: str, data: str | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... diff --git a/tests/regr_test.py b/tests/regr_test.py index c8fc9e91202c..b6569f00853a 100755 --- a/tests/regr_test.py +++ b/tests/regr_test.py @@ -13,7 +13,7 @@ import sys import tempfile import threading -from collections.abc import Callable, Iterator +from collections.abc import Callable, Generator from contextlib import ExitStack, contextmanager, suppress from dataclasses import dataclass from enum import IntEnum @@ -316,7 +316,7 @@ def concurrently_run_testcases( @contextmanager def cleanup_threads( event: threading.Event, printer_thread: threading.Thread, executor: concurrent.futures.ThreadPoolExecutor - ) -> Iterator[None]: + ) -> Generator[None]: try: yield except: