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
Xavier Thompson
cython
Commits
8b4b461f
Commit
8b4b461f
authored
Jul 30, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix type inference for comparison operations with cpp types
parent
868a2607
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
8b4b461f
...
...
@@ -13198,11 +13198,20 @@ class PrimaryCmpNode(ExprNode, CmpNode):
def
infer_type
(
self
,
env
):
type1
=
self
.
operand1
.
infer_type
(
env
)
type2
=
self
.
operand2
.
infer_type
(
env
)
operator
=
self
.
operator
if
is_pythran_expr
(
type1
)
or
is_pythran_expr
(
type2
):
if
is_pythran_supported_type
(
type1
)
and
is_pythran_supported_type
(
type2
):
return
PythranExpr
(
pythran_binop_type
(
self
.
operator
,
type1
,
type2
))
cpp_type
=
None
if
type1
.
is_cpp_class
or
type1
.
is_ptr
:
cpp_type
=
type1
.
find_cpp_operation_type
(
operator
,
type2
)
if
cpp_type
is
None
and
(
type2
.
is_cpp_class
or
type2
.
is_ptr
):
cpp_type
=
type2
.
find_cpp_operation_type
(
operator
,
type1
)
if
cpp_type
is
not
None
:
return
cpp_type
# TODO: implement this for other types.
return
py_object_type
...
...
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