pythonizer icon indicating copy to clipboard operation
pythonizer copied to clipboard

Statement with both a bash-style "and" and a trailing "if" generates wrong code

Open snoopyjc opened this issue 3 years ago • 1 comments

Statement with both a bash-style "and" and a trailing "if" generates wrong code. For example:

go_outside() and play() unless $is_raining;

generates:

if go_outside():
    if not (is_raining):
        play()

but the correct code is:

if not (is_raining):
    if go_outside():
        play()

snoopyjc avatar Feb 09 '22 05:02 snoopyjc

Fixed in https://github.com/snoopyjc/pythonizer v0.951

snoopyjc avatar Feb 18 '22 05:02 snoopyjc