From 1de9c82d4a2d0be6c77c26147c9fd848f2304099 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 25 Jun 2023 17:17:31 +0200 Subject: [PATCH] common/_itertools: Add documentation to all_same --- server/entertainment_decider/common/_itertools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/entertainment_decider/common/_itertools.py b/server/entertainment_decider/common/_itertools.py index c15b82c..edd2239 100644 --- a/server/entertainment_decider/common/_itertools.py +++ b/server/entertainment_decider/common/_itertools.py @@ -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)