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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
3a57260e
Commit
3a57260e
authored
Oct 28, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Looks like Py2 requires "__ne__()" in addition to "__eq__()" for a correct implementation.
parent
fe94b2f5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+5
-0
No files found.
Cython/Compiler/PyrexTypes.py
View file @
3a57260e
...
...
@@ -1471,6 +1471,7 @@ class CType(PyrexType):
source_code
,
code
.
error_goto_if
(
error_condition
or
self
.
error_condition
(
result_code
),
error_pos
))
class
PythranExpr
(
CType
):
# Pythran object of a given type
...
...
@@ -1510,6 +1511,10 @@ class PythranExpr(CType):
"""Equality operation for PythranExpr using the str representation"""
return
isinstance
(
other
,
PythranExpr
)
and
self
.
pythran_type
==
other
.
pythran_type
def
__ne__
(
self
,
other
):
"""Equality operation for PythranExpr using the str representation"""
return
not
isinstance
(
other
,
PythranExpr
)
or
self
.
pythran_type
!=
other
.
pythran_type
def
__hash__
(
self
):
"""Hash function using the str representation"""
return
hash
(
self
.
pythran_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