Avoid removing side effects for boolean simplifications (#1984)

Closes #1978.
This commit is contained in:
Charlie Marsh
2023-01-18 19:08:14 -05:00
committed by GitHub
parent ceb48d3a32
commit 34412a0a01
2 changed files with 21 additions and 3 deletions

View File

@@ -7,8 +7,12 @@ if (a or b) or True: # SIM223
if a or (b or True): # SIM223
pass
if a and True:
if a and True: # OK
pass
if True:
if True: # OK
pass
def validate(self, value):
return json.loads(value) or True # OK