diff options
Diffstat (limited to 'rpython/annotator/builtin.py')
-rw-r--r-- | rpython/annotator/builtin.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rpython/annotator/builtin.py b/rpython/annotator/builtin.py index b1915d966d..c971f63493 100644 --- a/rpython/annotator/builtin.py +++ b/rpython/annotator/builtin.py @@ -86,8 +86,13 @@ def builtin_range(*args): builtin_xrange = builtin_range # xxx for now allow it -def builtin_enumerate(s_obj): - return SomeIterator(s_obj, "enumerate") +def builtin_enumerate(s_obj, s_start=None): + const = None + if s_start is not None: + if not s_start.is_constant(): + raise AnnotatorError("second argument to enumerate must be constant") + const = s_start.const + return SomeIterator(s_obj, "enumerate", const) def builtin_reversed(s_obj): |