Skip to content

Commit

Permalink
Merge pull request #157 from rocky/add-if-or-not
Browse files Browse the repository at this point in the history
Correct 3.8 weird negation of condition in ifstmt
  • Loading branch information
rocky authored Nov 12, 2023
2 parents 302a30c + e5de0be commit 88f54ab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file added test/bytecode_3.8/run/02_test_if_not.pyc
Binary file not shown.
16 changes: 16 additions & 0 deletions test/simple_source/bug38/02_test_if_not.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Issue 478 of uncompile
"This file is self checking"
# Problem was confusing "a or not b" with
# its negation: "not a or b".


def testit(a, b):
if a or not b:
return True
return False


assert testit(True, True) is True
assert testit(True, False) is True
assert testit(False, True) is False
assert testit(False, False) is True

0 comments on commit 88f54ab

Please sign in to comment.