Python: Fix simple guards

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-09-06 22:40:30 +02:00
parent 913990bc62
commit 4998a48f99
3 changed files with 78 additions and 31 deletions

View File

@@ -124,11 +124,23 @@ def dict_update_op_nochange(d = {}):
# OK
def sanitizer(l = []):
if l:
l.append(1) #$ modification=l
l.append(1)
return l
# OK
def sanitizer_negated(l = [1]):
if not l:
l.append(1) #$ SPURIOUS: modification=l
l.append(1)
return l
# Not OK
def sanitizer(l = []):
if not l:
l.append(1) #$ modification=l
return l
# Not OK
def sanitizer_negated(l = [1]):
if l:
l.append(1) #$ modification=l
return l