Are there syntax checkers able to detect broken code based on edge cases. An example:
def run():
for j in [0, 1]:
if j == 0:
yield j
else:
yield None
for i in run():
print i * 2
This code is broken because None * 2 does not make sense. Are there tools to detect this kind of error ?
Thank you
NameError: j is not definedor something when you run it.Line 10: TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'