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

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

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

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

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

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

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