diff --git a/src/appier/legacy.py b/src/appier/legacy.py index a0d79d14..92c7e972 100644 --- a/src/appier/legacy.py +++ b/src/appier/legacy.py @@ -131,6 +131,38 @@ def eager(iterable): if PYTHON_3: return list(iterable) return iterable +def iteritems(associative): + if PYTHON_3: return associative.items() + return associative.iteritems() + +def iterkeys(associative): + if PYTHON_3: return associative.keys() + return associative.iterkeys() + +def itervalues(associative): + if PYTHON_3: return associative.values() + return associative.itervalues() + +def items(associative): + if PYTHON_3: return eager(associative.items()) + return associative.items() + +def keys(associative): + if PYTHON_3: return eager(associative.keys()) + return associative.keys() + +def values(associative): + if PYTHON_3: return eager(associative.values()) + return associative.values() + +def xrange(associative): + if PYTHON_3: return associative.range() + return associative.xrange() + +def range(associative): + if PYTHON_3: return eager(associative.range()) + return associative.range() + def ord(value): if PYTHON_3 and type(value) == int: return value return _ord(value)