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
Boxiang Sun
cython
Commits
919ae401
Commit
919ae401
authored
Dec 04, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep type information when coercing from C complex to Python complex
parent
7dc3409c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+11
-6
No files found.
Cython/Compiler/ExprNodes.py
View file @
919ae401
...
...
@@ -7074,12 +7074,17 @@ class CoerceToPyTypeNode(CoercionNode):
if
not
arg
.
type
.
create_to_py_utility_code
(
env
):
error
(
arg
.
pos
,
"Cannot convert '%s' to Python object"
%
arg
.
type
)
if
type
is
not
py_object_type
:
self
.
type
=
py_object_type
elif
arg
.
type
.
is_string
:
self
.
type
=
bytes_type
elif
arg
.
type
is
PyrexTypes
.
c_py_unicode_type
:
self
.
type
=
unicode_type
if
type
is
py_object_type
:
# be specific about some known types
if
arg
.
type
.
is_string
:
self
.
type
=
bytes_type
elif
arg
.
type
is
PyrexTypes
.
c_py_unicode_type
:
self
.
type
=
unicode_type
elif
arg
.
type
.
is_complex
:
self
.
type
=
Builtin
.
complex_type
else
:
# FIXME: check that the target type and the resulting type are compatible
pass
gil_message
=
"Converting to Python object"
...
...
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