projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
878d841
)
extended test case
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 4 Dec 2009 10:21:56 +0000
(11:21 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 4 Dec 2009 10:21:56 +0000
(11:21 +0100)
tests/run/type_inference.pyx
patch
|
blob
|
history
diff --git
a/tests/run/type_inference.pyx
b/tests/run/type_inference.pyx
index aa188f5b529196259821dc273c44a521ffda203d..3ba8e0bf58a501ec60af055b4a0a265b145ad9dd 100644
(file)
--- 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():
"""