Python syntax checkers that test edge cases
<p>Are there syntax checkers able to detect broken code based on edge cases. An example:</p>

<pre><code>def run():
    for j in [0, 1]:
        if j == 0:
            yield j
        else:
            yield None


for i in run():
    print i * 2
</code></pre>

<p>This code is broken because <code>None * 2</code> does not make sense. Are there tools to detect this kind of error ?</p>

<p>Thank you</p>

<p>You need a type checker, not a syntax checker. <a href="https://github.com/python/mypy" rel="nofollow">github.com/python/mypy</a></p>

python syntax-checking