More 2.6 control flow logix futzing

This commit is contained in:
rocky
2018-05-09 11:12:16 -04:00
parent 24ccc16701
commit 80b68af2d3
3 changed files with 31 additions and 6 deletions

View File

@@ -0,0 +1,17 @@
# From 2.6 test_datetime.py
# Bug is in parsing (x is 0 or x is 1) and (y is 5 or y is 2)
# correctly.
# This code is RUNNABLE!
result = []
for y in (1, 2, 10):
x = cmp(1, y)
if (x is 0 or x is 1) and (y is 5 or y is 2):
expected = 10
elif y is 2:
expected = 2
else:
expected = 3
result.append(expected)
assert result == [10, 2, 3]