Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
e871e864
Commit
e871e864
authored
Sep 24, 2019
by
Stephan Seitz
Browse files
Add __hash__ and __eq__ to CustomCodeNode
parent
6aeab41e
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/backends/cbackend.py
View file @
e871e864
...
...
@@ -132,6 +132,12 @@ class CustomCodeNode(Node):
def
undefined_symbols
(
self
):
return
self
.
_symbols_read
-
self
.
_symbols_defined
def
__eq___
(
self
,
other
):
return
self
.
_code
==
other
.
_code
def
__hash__
(
self
):
return
hash
(
self
.
_code
)
class
PrintNode
(
CustomCodeNode
):
# noinspection SpellCheckingInspection
...
...
@@ -434,6 +440,7 @@ class CustomSympyPrinter(CCodePrinter):
condition
=
self
.
_print
(
var
)
+
' <= '
+
self
.
_print
(
end
)
# if start < end else '>='
)
return
code
_print_Max
=
C89CodePrinter
.
_print_Max
_print_Min
=
C89CodePrinter
.
_print_Min
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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