From: Robert Bradshaw Date: Sat, 31 Jul 2010 03:30:37 +0000 (-0700) Subject: Testcase for #564, refcount bug in isinstance optimization X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7354f5085f33ebef172f64a93b110e4d612fe6a6;p=cython.git Testcase for #564, refcount bug in isinstance optimization --- diff --git a/tests/run/isinstance.pyx b/tests/run/isinstance.pyx index 75a9f536..0519b346 100644 --- a/tests/run/isinstance.pyx +++ b/tests/run/isinstance.pyx @@ -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