---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.pyi:9:27
   |
 8 | class TypingIterableTReturn:
 9 |     def __iter__(self) -> typing.Iterable[int]: ...  # Error: PYI045
   |                           ^^^^^^^^^^^^^^^^^^^^
10 |     def not_iter(self) -> typing.Iterable[int]: ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.pyi:13:27
   |
12 | class TypingIterableReturn:
13 |     def __iter__(self) -> typing.Iterable: ...  # Error: PYI045
   |                           ^^^^^^^^^^^^^^^
14 |     def not_iter(self) -> typing.Iterable: ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.pyi:17:27
   |
16 | class CollectionsIterableTReturn:
17 |     def __iter__(self) -> collections.abc.Iterable[int]: ...  # Error: PYI045
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 |     def not_iter(self) -> collections.abc.Iterable[int]: ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.pyi:21:27
   |
20 | class CollectionsIterableReturn:
21 |     def __iter__(self) -> collections.abc.Iterable: ...  # Error: PYI045
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^
22 |     def not_iter(self) -> collections.abc.Iterable: ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.pyi:25:27
   |
24 | class IterableReturn:
25 |     def __iter__(self) -> Iterable: ...  # Error: PYI045
   |                           ^^^^^^^^
26 |
27 | class IteratorReturn:
   |

PYI045 `__aiter__` methods should return an `AsyncIterator`, not an `AsyncIterable`
  --> PYI045.pyi:46:28
   |
45 | class TypingAsyncIterableTReturn:
46 |     def __aiter__(self) -> typing.AsyncIterable[int]: ...  # Error: PYI045
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^
47 |
48 | class TypingAsyncIterableReturn:
   |

PYI045 `__aiter__` methods should return an `AsyncIterator`, not an `AsyncIterable`
  --> PYI045.pyi:49:28
   |
48 | class TypingAsyncIterableReturn:
49 |     def __aiter__(self) -> typing.AsyncIterable: ...  # Error: PYI045
   |                            ^^^^^^^^^^^^^^^^^^^^
   |
