projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a2e535
)
extended test case
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 4 Dec 2010 09:46:51 +0000
(10:46 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 4 Dec 2010 09:46:51 +0000
(10:46 +0100)
tests/run/builtincomplex.pyx
patch
|
blob
|
history
diff --git
a/tests/run/builtincomplex.pyx
b/tests/run/builtincomplex.pyx
index 603611753ac270616e5691dcffb6742a42fbbc69..90a24b4879db8b797d127b09736a2aeaac0e95f2 100644
(file)
--- a/
tests/run/builtincomplex.pyx
+++ b/
tests/run/builtincomplex.pyx
@@
-27,3
+27,13
@@
def complex_cstruct_assign():
cval = &c.cval
cval.real, cval.imag = 10, 20
return (c.real, c.imag)
+
+def complex_coercion():
+ """
+ >>> complex_coercion()
+ (1.0, 2.0, 1.0, 2.0)
+ """
+ cdef complex py_c = 1+2j
+ cdef double complex c_c = py_c
+ cdef object py = c_c
+ return (c_c.real, c_c.imag, py.real, py.imag)