diff --git a/src/__init__.py b/src/__init__.py index df1f2032a545c72e38d857e8ce80af27ebc1f66c..7054e3a581771c0dba5fe991a81e3b1ab67996ab 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -621,6 +621,25 @@ def product(iterable): +try: + all = __builtins__.all + any = __builtins__.any +except AttributeError: + def all(iterable): + for i in iterable: + if not i: + return False + return True + + def any(iterable): + for i in iterable: + if i: + return True + return False + + + + def argmin_f(list, f = lambda x: x): # deprecated -- the function has become unnecessary because of # generator expressions