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
Sebastian Bindgen
pystencils
Commits
f4008b32
Commit
f4008b32
authored
Jan 17, 2020
by
Stephan Seitz
Browse files
Print actual block contents in Conditional.{__repr__,__str__}
parent
b0aae533
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/astnodes.py
View file @
f4008b32
...
...
@@ -110,10 +110,17 @@ class Conditional(Node):
return
result
def
__str__
(
self
):
return
'if:({!s}) '
.
format
(
self
.
condition_expr
)
return
self
.
__repr__
(
)
def
__repr__
(
self
):
return
'if:({!r}) '
.
format
(
self
.
condition_expr
)
repr
=
'if:({!r}) '
.
format
(
self
.
condition_expr
)
if
self
.
true_block
:
repr
+=
'
\n\t
{}) '
.
format
(
self
.
true_block
)
if
self
.
false_block
:
repr
=
'else: '
.
format
(
self
.
false_block
)
repr
+=
'
\n\t
{} '
.
format
(
self
.
false_block
)
return
repr
def
replace_by_true_block
(
self
):
"""Replaces the conditional by its True block"""
...
...
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