[pypy-svn] r37416 - pypy/dist/pypy/jit/timeshifter/test

cfbolz at codespeak.net cfbolz at codespeak.net
Sat Jan 27 01:05:01 CET 2007


Author: cfbolz
Date: Sat Jan 27 01:05:00 2007
New Revision: 37416

Modified:
   pypy/dist/pypy/jit/timeshifter/test/test_portal.py
Log:
hm, why is the result of isinstance red here?


Modified: pypy/dist/pypy/jit/timeshifter/test/test_portal.py
==============================================================================
--- pypy/dist/pypy/jit/timeshifter/test/test_portal.py	(original)
+++ pypy/dist/pypy/jit/timeshifter/test/test_portal.py	Sat Jan 27 01:05:00 2007
@@ -399,3 +399,31 @@
         res = self.timeshift_from_portal(main, evaluate, [4, 7])
         assert res == 11
     
+    def test_isinstance(self):
+        py.test.skip("(cfbolz) don't get it")
+        class Base(object):
+            pass
+        class Int(Base):
+            def __init__(self, n):
+                self.n = n
+        class Str(Base):
+            def __init__(self, s):
+                self.s = s
+
+        def ll_main(n):
+            if n > 0:
+                o = Int(n)
+            else:
+                o = Str('123')
+            return ll_function(o)
+
+        def ll_function(o):
+            hint(o, deepfreeze=True)
+            hint(o, concrete=True)
+            x = isinstance(o, Str)
+            return x
+            
+
+        res = self.timeshift_from_portal(ll_main, ll_function, [5], policy=P_NOVIRTUAL)
+        assert res == 10
+



More information about the Pypy-commit mailing list