Raises nested within ternary expressions produce output which is not valid python:
Discovered while working on #364
How to Reproduce
Python output:
return 10 if x > 0 else raise Err("Expected positive number.")
Mamba input is identical.
Expected behavior
I want this to still be valid Mamba code.
So in such situations it should be converted to a if else and not a ternary expressions.
Need to think about how we keep this as generic as possible, put I suppose this is no longer an issue as soon as an expression has become a code block, because that should be dealt with within #364.
Description of Bug
Raises nested within ternary expressions produce output which is not valid python: Discovered while working on #364
How to Reproduce
Python output:
return 10 if x > 0 else raise Err("Expected positive number.")
Mamba input is identical.Expected behavior
I want this to still be valid Mamba code. So in such situations it should be converted to a if else and not a ternary expressions. Need to think about how we keep this as generic as possible, put I suppose this is no longer an issue as soon as an expression has become a code block, because that should be dealt with within #364.