Testcase for #564, refcount bug in isinstance optimization
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 31 Jul 2010 03:30:37 +0000 (20:30 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 31 Jul 2010 03:30:37 +0000 (20:30 -0700)
tests/run/isinstance.pyx

index 75a9f5366d72c5ac0c0f77054f3cb7ef1c4ad65c..0519b346affa3ac732c244fc5d1422b12422ab84 100644 (file)
@@ -73,3 +73,17 @@ def test_custom():
     """
     assert isinstance(A(), A)
     return True
+
+def test_nested(x):
+    """
+    >>> test_nested(1)
+    True
+    >>> test_nested(1.5)
+    True
+    >>> test_nested("a")
+    False
+    """
+    cdef object a = (x, None)
+    if isinstance(a[0], (int, float)):
+        return True
+    return False