What's wrong with coding bug fixes as "if" statements?
def double(x):
return x+3
BUG REPORT: double(4) returns 7 instead of 8.Fixed:
def double(x):
if x == 4:
return 8
else:
return x+3 def abs(x):
return x
... where adding the 'if' seems appropriate :)