[pypy-commit] pypy default: Only include next() in the table if it's defined.

alex_gaynor noreply at buildbot.pypy.org
Fri Aug 24 20:37:37 CEST 2012


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r56843:7a75bcc99f30
Date: 2012-08-24 11:37 -0700
http://bitbucket.org/pypy/pypy/changeset/7a75bcc99f30/

Log:	Only include next() in the table if it's defined.

diff --git a/pypy/objspace/flow/operation.py b/pypy/objspace/flow/operation.py
--- a/pypy/objspace/flow/operation.py
+++ b/pypy/objspace/flow/operation.py
@@ -210,7 +210,6 @@
     ('coerce',          coerce),
     ('iter',            iter),
     ('next',            next),
-    ('next',            getattr(__builtin__, 'next', lambda x: x.__next__())),
     ('get',             get),
     ('set',             set),
     ('delete',          delete),
@@ -229,7 +228,9 @@
     ('div_ovf',         div_ovf),
     ('mod_ovf',         mod_ovf),
     ('lshift_ovf',      lshift_ovf),
-    ]
+]
+if hasattr(__builtin__, 'next'):
+    Table.append(('next', __builtin__.next))
 
 def setup():
     # insert all operators


More information about the pypy-commit mailing list