Commit a26f40a1 authored by Vincent Pelletier's avatar Vincent Pelletier

Allow using enumerate's "start" argument on python>=2.6 .

parent fc016de0
......@@ -110,6 +110,11 @@ def guarded_reversed(seq):
return SafeIter(reversed(seq))
safe_builtins['reversed'] = guarded_reversed
if sys.version_info >= (2, 6):
def guarded_enumerate(seq, start=0):
return NullIter(enumerate(guarded_iter(seq), start=start))
safe_builtins['enumerate'] = guarded_enumerate
def get_set_pop(s, name):
def guarded_pop():
v = s.pop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment