From 7354f5085f33ebef172f64a93b110e4d612fe6a6 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 30 Jul 2010 20:30:37 -0700 Subject: [PATCH] Testcase for #564, refcount bug in isinstance optimization --- tests/run/isinstance.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.26.2