Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch: py3.6
Changeset: r97535:7ea1a4ba3ea1
Date: 2019-09-19 11:45 +0200
http://bitbucket.org/pypy/pypy/changeset/7ea1a4ba3ea1/
Log: change test_peepholer: PyPy implements the feature, but the limit is
different than CPython's
diff --git a/lib-python/3/test/test_peepholer.py
b/lib-python/3/test/test_peepholer.py
--- a/lib-python/3/test/test_peepholer.py
+++ b/lib-python/3/test/test_peepholer.py
@@ -189,9 +189,11 @@
code = compile('a=1<<1000', '', 'single')
self.assertInBytecode(code, 'LOAD_CONST', 1000)
self.assertNotIn(1<<1000, code.co_consts)
- code = compile('a=2**1000', '', 'single')
- self.assertInBytecode(code, 'LOAD_CONST', 1000)
- self.assertNotIn(2**1000, code.co_consts)
+ # difference to CPython: PyPy allows slightly larger constants to be
+ # created
+ code = compile('a=2**10000', '', 'single')
+ self.assertInBytecode(code, 'LOAD_CONST', 10000)
+ self.assertNotIn(2**10000, code.co_consts)
@cpython_only # we currently not bother to implement that
def test_binary_subscr_on_unicode(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit