extended test case
authorStefan Behnel <scoder@users.berlios.de>
Fri, 4 Dec 2009 10:21:56 +0000 (11:21 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 4 Dec 2009 10:21:56 +0000 (11:21 +0100)
tests/run/type_inference.pyx

index aa188f5b529196259821dc273c44a521ffda203d..3ba8e0bf58a501ec60af055b4a0a265b145ad9dd 100644 (file)
@@ -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():
     """