Summary
The bad
def foo(a, b, c):
if a:
if b:
if c:
return 1
else:
return 2
else:
return 3
else:
return 4
and good
def foo(a, b, c):
if not a:
return 4
if not b:
return 3
if not c:
return 2
return 1
examples for C901 have the same McCabe complexity (4), so the lint would also trigger for the good example if it would trigger for the bad example.
Summary
The bad
and good
examples for C901 have the same McCabe complexity (4), so the lint would also trigger for the good example if it would trigger for the bad example.