[pypy-commit] pypy win64-stage1: a few more int/long unifications.

ctismer noreply at buildbot.pypy.org
Thu Nov 24 00:26:26 CET 2011


Author: Christian Tismer <tismer at stackless.com>
Branch: win64-stage1
Changeset: r49713:53b5e001b4db
Date: 2011-11-23 23:17 +0100
http://bitbucket.org/pypy/pypy/changeset/53b5e001b4db/

Log:	a few more int/long unifications. XXX I think this should be
	replaced by a range checking function.

diff --git a/pypy/annotation/builtin.py b/pypy/annotation/builtin.py
--- a/pypy/annotation/builtin.py
+++ b/pypy/annotation/builtin.py
@@ -163,7 +163,7 @@
                         r.const = False
                 return r
                 
-            assert not issubclass(typ, (int, long)) or typ in (bool, int), (
+            assert not issubclass(typ, (int, long)) or typ in (bool, int, long), (
                 "for integers only isinstance(.,int|r_uint) are supported")
  
             if s_obj.is_constant():
diff --git a/pypy/interpreter/test/test_compiler.py b/pypy/interpreter/test/test_compiler.py
--- a/pypy/interpreter/test/test_compiler.py
+++ b/pypy/interpreter/test/test_compiler.py
@@ -794,7 +794,7 @@
     def test_tuple_constants(self):
         ns = {}
         exec "x = (1, 0); y = (1L, 0L)" in ns
-        assert isinstance(ns["x"][0], int)
+        assert isinstance(ns["x"][0], (int, long))
         assert isinstance(ns["y"][0], long)
 
     def test_division_folding(self):
diff --git a/pypy/rpython/test/test_rbuiltin.py b/pypy/rpython/test/test_rbuiltin.py
--- a/pypy/rpython/test/test_rbuiltin.py
+++ b/pypy/rpython/test/test_rbuiltin.py
@@ -542,7 +542,7 @@
         if r_longlong is not r_int:
             assert isinstance(res, r_longlong)
         else:
-            assert isinstance(res, int)
+            assert isinstance(res, (int, long))
         #
         def llfn(v):
             return rffi.cast(rffi.ULONGLONG, v)


More information about the pypy-commit mailing list