diff --git a/pixelocr/utils.py b/pixelocr/utils.py index e7912d0..c1fc320 100644 --- a/pixelocr/utils.py +++ b/pixelocr/utils.py @@ -29,3 +29,10 @@ def cached_property(fun): ret = self._cache[fun] = fun(self) return ret return property(get) + + +def collect_iterable(func): + @functools.wraps(func) + def collect(*args, **kwargs): + return list(func(*args, **kwargs)) + return collect