From 662dc309192f0facf09c68145e84f49bb010b35a Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sat, 28 Mar 2009 17:12:56 +0100 Subject: [PATCH] Testcase for #267 --- tests/bugs/ifelseexpr_T267.pyx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/bugs/ifelseexpr_T267.pyx diff --git a/tests/bugs/ifelseexpr_T267.pyx b/tests/bugs/ifelseexpr_T267.pyx new file mode 100644 index 00000000..096b27ec --- /dev/null +++ b/tests/bugs/ifelseexpr_T267.pyx @@ -0,0 +1,28 @@ +""" +>>> constants(5) +1 +>>> constants(6) +10 +>>> temps(5) +1 +>>> temps(6) +10 +>>> nested(1) +1 +>>> nested(2) +2 +>>> nested(3) +3 +""" + +def ident(x): return x + +def constants(x): + a = 1 if x < 5 else 10 + return a + +def temps(x): + return ident(1) if ident(x) < ident(5) else ident(10) + +def nested(x): + return 1 if x == 1 else (2 if x == 2 else 3) -- 2.26.2