Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
ac24781e
Commit
ac24781e
authored
Nov 02, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporary fix for #441
parent
c8b85056
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+7
-0
tests/run/complex_numbers_T305.pyx
tests/run/complex_numbers_T305.pyx
+7
-7
No files found.
Cython/Compiler/PyrexTypes.py
View file @
ac24781e
...
@@ -913,6 +913,13 @@ class CComplexType(CNumericType):
...
@@ -913,6 +913,13 @@ class CComplexType(CNumericType):
real_type_name
=
real_type_name
.
replace
(
'long__double'
,
'long_double'
)
real_type_name
=
real_type_name
.
replace
(
'long__double'
,
'long_double'
)
return
Naming
.
type_prefix
+
real_type_name
+
"_complex"
return
Naming
.
type_prefix
+
real_type_name
+
"_complex"
def
assignable_from
(
self
,
src_type
):
# Temporary hack/feature disabling, see #441
if
not
src_type
.
is_complex
and
src_type
.
is_numeric
and
src_type
.
is_typedef
:
return
False
else
:
return
super
(
CComplexType
,
self
).
assignable_from
(
src_type
)
def
assignable_from_resolved_type
(
self
,
src_type
):
def
assignable_from_resolved_type
(
self
,
src_type
):
return
(
src_type
.
is_complex
and
self
.
real_type
.
assignable_from_resolved_type
(
src_type
.
real_type
)
return
(
src_type
.
is_complex
and
self
.
real_type
.
assignable_from_resolved_type
(
src_type
.
real_type
)
or
src_type
.
is_numeric
and
self
.
real_type
.
assignable_from_resolved_type
(
src_type
)
or
src_type
.
is_numeric
and
self
.
real_type
.
assignable_from_resolved_type
(
src_type
)
...
...
tests/run/complex_numbers_T305.pyx
View file @
ac24781e
...
@@ -125,13 +125,13 @@ ctypedef double complex cdouble
...
@@ -125,13 +125,13 @@ ctypedef double complex cdouble
def
test_conjugate_typedef
(
cdouble
z
):
def
test_conjugate_typedef
(
cdouble
z
):
return
z
.
conjugate
()
return
z
.
conjugate
()
ctypedef
double
mydouble
#
ctypedef double mydouble
def
test_coerce_typedef_multiply
(
mydouble
x
,
double
complex
z
):
#
def test_coerce_typedef_multiply(mydouble x, double complex z):
"""
#
"""
>>> test_coerce_typedef_multiply(3, 1j)
#
>>> test_coerce_typedef_multiply(3, 1j)
(3j)
#
(3j)
"""
#
"""
return
x
*
z
#
return x * z
cpdef
double
complex
complex_retval
():
cpdef
double
complex
complex_retval
():
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment