From 1830d1e7f6decd7a018d700968b315932a08d023 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 4 Dec 2009 11:21:56 +0100 Subject: [PATCH] extended test case --- tests/run/type_inference.pyx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/run/type_inference.pyx b/tests/run/type_inference.pyx index aa188f5b..3ba8e0bf 100644 --- a/tests/run/type_inference.pyx +++ b/tests/run/type_inference.pyx @@ -147,6 +147,25 @@ def loop(): pass assert typeof(a) == "long" +cdef unicode retu(): + return u"12345" + +cdef bytes retb(): + return b"12345" + +def conditional(x): + """ + >>> conditional(True) + (True, 'Python object') + >>> conditional(False) + (False, 'Python object') + """ + if x: + a = retu() + else: + a = retb() + return type(a) is unicode, typeof(a) + @infer_types('safe') def safe_only(): """ -- 2.26.2