[pypy-commit] pypy py3k: utilize enumerate
pjenvey
pypy.commits at gmail.com
Sat May 21 22:00:12 EDT 2016
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r84568:d463dd98e6a6
Date: 2016-05-21 18:23 -0700
http://bitbucket.org/pypy/pypy/changeset/d463dd98e6a6/
Log: utilize enumerate
diff --git a/pypy/module/__builtin__/descriptor.py b/pypy/module/__builtin__/descriptor.py
--- a/pypy/module/__builtin__/descriptor.py
+++ b/pypy/module/__builtin__/descriptor.py
@@ -70,11 +70,9 @@
w_obj = frame.locals_cells_stack_w[0]
if not w_obj:
raise oefmt(space.w_RuntimeError, "super(): arg[0] deleted")
- index = 0
- for name in code.co_freevars:
+ for index, name in enumerate(code.co_freevars):
if name == "__class__":
break
- index += 1
else:
raise oefmt(space.w_RuntimeError, "super(): __class__ cell not found")
# a kind of LOAD_DEREF
More information about the pypy-commit
mailing list