[pypy-commit] pypy py3k: Fix constant-folding for '**'

rlamy pypy.commits at gmail.com
Thu Aug 18 11:36:47 EDT 2016


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3k
Changeset: r86283:9e01cc8cdef4
Date: 2016-08-18 16:36 +0100
http://bitbucket.org/pypy/pypy/changeset/9e01cc8cdef4/

Log:	Fix constant-folding for '**'

diff --git a/pypy/interpreter/astcompiler/optimize.py b/pypy/interpreter/astcompiler/optimize.py
--- a/pypy/interpreter/astcompiler/optimize.py
+++ b/pypy/interpreter/astcompiler/optimize.py
@@ -118,7 +118,7 @@
     # don't constant-fold if "w_left" and "w_right" are integers and
     # the estimated bit length of the power is unreasonably large
     space.appexec([w_left, w_right], """(left, right):
-        if isinstance(left, (int, long)) and isinstance(right, (int, long)):
+        if isinstance(left, int) and isinstance(right, int):
             if left.bit_length() * right > 5000:
                 raise OverflowError
     """)


More information about the pypy-commit mailing list