---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.py:12:27
   |
11 | class TypingIterableTReturn:
12 |     def __iter__(self) -> typing.Iterable[int]:
   |                           ^^^^^^^^^^^^^^^^^^^^
13 |         ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.py:20:27
   |
19 | class TypingIterableReturn:
20 |     def __iter__(self) -> typing.Iterable:
   |                           ^^^^^^^^^^^^^^^
21 |         ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.py:28:27
   |
27 | class CollectionsIterableTReturn:
28 |     def __iter__(self) -> collections.abc.Iterable[int]:
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 |         ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.py:36:27
   |
35 | class CollectionsIterableReturn:
36 |     def __iter__(self) -> collections.abc.Iterable:
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^
37 |         ...
   |

PYI045 `__iter__` methods should return an `Iterator`, not an `Iterable`
  --> PYI045.py:44:27
   |
43 | class IterableReturn:
44 |     def __iter__(self) -> Iterable:
   |                           ^^^^^^^^
45 |         ...
   |

PYI045 `__aiter__` methods should return an `AsyncIterator`, not an `AsyncIterable`
  --> PYI045.py:79:28
   |
78 | class TypingAsyncIterableTReturn:
79 |     def __aiter__(self) -> typing.AsyncIterable[int]:
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^
80 |         ...
   |

PYI045 `__aiter__` methods should return an `AsyncIterator`, not an `AsyncIterable`
  --> PYI045.py:84:28
   |
83 | class TypingAsyncIterableReturn:
84 |     def __aiter__(self) -> typing.AsyncIterable:
   |                            ^^^^^^^^^^^^^^^^^^^^
85 |         ...
   |
