We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd183dd commit 0cb0e85Copy full SHA for 0cb0e85
parsel/utils.py
@@ -29,7 +29,11 @@ def flatten(x: Iterable[Any]) -> list[Any]:
29
30
def iflatten(x: Iterable[Any]) -> Iterator[Any]:
31
"""iflatten(sequence) -> Iterator
32
- Similar to ``.flatten()``, but returns iterator instead"""
+ Similar to ``.flatten()``, but returns iterator instead
33
+ Examples:
34
+ >>> list(iflatten([[1, 2], (3, 4)]))
35
+ [1, 2, 3, 4]
36
+ """
37
for el in x:
38
if _is_listlike(el):
39
yield from flatten(el)
0 commit comments