common/_itertools: Add documentation to all_same

master
Felix Stupp 10 months ago
parent f91f15e81f
commit 1de9c82d4a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -17,6 +17,9 @@ T = TypeVar("T")
def all_same(iterable: Iterable) -> bool:
"""
Returns True if all items of Iterable are equal, False otherwise.
"""
it = iter(iterable)
first = next(it)
return all(first == elem for elem in it)

Loading…
Cancel
Save