diff --git a/utils/functional.py b/utils/functional.py index d18fa93..2c3cdaa 100644 --- a/utils/functional.py +++ b/utils/functional.py @@ -3,11 +3,16 @@ from __future__ import unicode_literals # Erik Stein , 2017 -def firstof(iterable, default=None): +def firstof(*args, default=None): """ Returns the first value which is neither empty nor None. """ + if len(args) == 1: + iterable = args[0] + else: + iterable = args + for value in iterable: if value: return value