diff options
author | Matti Picus <matti.picus@gmail.com> | 2022-03-28 12:50:42 +0300 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2022-03-28 12:50:42 +0300 |
commit | 73ed8cbff751b6c9d05a7578aa915c0d72cf7f1e (patch) | |
tree | 50f7ab60473d8e32d130966d97170bdbcbdbbfd5 /rpython/annotator/builtin.py | |
parent | merge default (diff) | |
parent | update release note (diff) | |
download | pypy-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.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): |