From: Stefan Behnel Date: Fri, 4 Dec 2009 10:21:56 +0000 (+0100) Subject: extended test case X-Git-Tag: 0.12.1~93 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1830d1e7f6decd7a018d700968b315932a08d023;p=cython.git extended test case --- 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(): """