Files
python-uncompyle6/test/simple_source/bug36/01_if_and_if_bug.py
rocky 4a354269bc Adjust 3.7 chained compare for adjusted grammar
Add test for last change
2019-03-23 17:06:50 -04:00

17 lines
360 B
Python

# Bug in 3.6 was not taking "else" branch after compond "if"
# In earlier versions we had else detection needed here.
def f(a, b, c):
if a and b:
x = 1
else:
x = 2
if c:
x = 3
return(x)
assert f(True, True, True) == 3
assert f(True, True, False) == 1
assert f(True, False, True) == 3
assert f(True, False, False) == 2