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
390ed7be
Commit
390ed7be
authored
Mar 06, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fix for double inference
parent
10de298c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
Cython/Compiler/TypeInference.py
Cython/Compiler/TypeInference.py
+3
-2
No files found.
Cython/Compiler/TypeInference.py
View file @
390ed7be
...
@@ -262,11 +262,12 @@ class SimpleAssignmentTypeInferer:
...
@@ -262,11 +262,12 @@ class SimpleAssignmentTypeInferer:
def
find_spanning_type
(
type1
,
type2
):
def
find_spanning_type
(
type1
,
type2
):
if
type1
is
type2
:
if
type1
is
type2
:
re
turn
type1
re
sult_type
=
type1
elif
type1
is
PyrexTypes
.
c_bint_type
or
type2
is
PyrexTypes
.
c_bint_type
:
elif
type1
is
PyrexTypes
.
c_bint_type
or
type2
is
PyrexTypes
.
c_bint_type
:
# type inference can break the coercion back to a Python bool
# type inference can break the coercion back to a Python bool
# if it returns an arbitrary int type here
# if it returns an arbitrary int type here
return
py_object_type
return
py_object_type
else
:
result_type
=
PyrexTypes
.
spanning_type
(
type1
,
type2
)
result_type
=
PyrexTypes
.
spanning_type
(
type1
,
type2
)
if
result_type
in
(
PyrexTypes
.
c_double_type
,
PyrexTypes
.
c_float_type
,
Builtin
.
float_type
):
if
result_type
in
(
PyrexTypes
.
c_double_type
,
PyrexTypes
.
c_float_type
,
Builtin
.
float_type
):
# Python's float type is just a C double, so it's safe to
# Python's float type is just a C double, so it's safe to
...
...
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