Skip to content

Commit 9c077b9

Browse files
committed
Make flatten() really return an iterator
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent db6f736 commit 9c077b9

File tree

1 file changed

+1
-1
lines changed
  • src/frequenz/repo/config/nox

1 file changed

+1
-1
lines changed

src/frequenz/repo/config/nox/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def flatten(iterables: Iterable[Iterable[_T]], /) -> Iterable[_T]:
2828
Example:
2929
>>> assert list(flatten([(1, 2), (3, 4)]) == [1, 2, 3, 4]
3030
"""
31-
return [item for sublist in iterables for item in sublist]
31+
return (item for sublist in iterables for item in sublist)
3232

3333

3434
def existing_paths(paths: Iterable[str], /) -> Iterable[pathlib.Path]:

0 commit comments

Comments
 (0)