aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-03-28 12:50:42 +0300
committerMatti Picus <matti.picus@gmail.com>2022-03-28 12:50:42 +0300
commit73ed8cbff751b6c9d05a7578aa915c0d72cf7f1e (patch)
tree50f7ab60473d8e32d130966d97170bdbcbdbbfd5 /rpython/annotator/builtin.py
parentmerge default (diff)
parentupdate release note (diff)
downloadpypy-73ed8cbff751b6c9d05a7578aa915c0d72cf7f1e.tar.gz
pypy-73ed8cbff751b6c9d05a7578aa915c0d72cf7f1e.tar.bz2
pypy-73ed8cbff751b6c9d05a7578aa915c0d72cf7f1e.zip
merge default into releaserelease-pypy2.7-v7.3.9
Diffstat (limited to 'rpython/annotator/builtin.py')
-rw-r--r--rpython/annotator/builtin.py9
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):