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
Frederik Hennig
pystencils
Commits
265c1933
Commit
265c1933
authored
Feb 16, 2022
by
Jan Hönig
Browse files
Fixing forgotten change to ast.Conditional in typing
parent
820ad582
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/typing/leaf_typing.py
View file @
265c1933
...
...
@@ -54,16 +54,14 @@ class TypeAdder:
if
isinstance
(
obj
,
(
sp
.
Eq
,
ast
.
SympyAssignment
,
Assignment
)):
return
self
.
process_assignment
(
obj
)
elif
isinstance
(
obj
,
ast
.
Conditional
):
condition
,
condition_type
=
self
.
figure_out_type
(
obj
.
condition_expr
)
assert
condition_type
==
BasicType
(
'bool'
)
true_block
=
self
.
visit
(
obj
.
true_block
)
false_block
=
None
if
obj
.
false_block
is
None
else
self
.
visit
(
obj
.
false_block
)
result
=
ast
.
Conditional
(
self
.
process_expression
(
obj
.
condition_expr
,
type_constants
=
False
),
true_block
=
self
.
visit
(
obj
.
true_block
),
false_block
=
false_block
)
return
result
return
ast
.
Conditional
(
condition
,
true_block
=
true_block
,
false_block
=
false_block
)
elif
isinstance
(
obj
,
ast
.
Block
):
result
=
ast
.
Block
([
self
.
visit
(
e
)
for
e
in
obj
.
args
])
return
result
return
ast
.
Block
([
self
.
visit
(
e
)
for
e
in
obj
.
args
])
elif
isinstance
(
obj
,
ast
.
Node
)
and
not
isinstance
(
obj
,
ast
.
LoopOverCoordinate
):
return
obj
else
:
...
...
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