On Tue Nov 18 2014 at 1:25:07 PM Claudiu Popa <pcmanticore@gmail.com> wrote:
I'm developing a Python static analysis tool that flags common
errors in Python programs. The tool is meant to complement other tools
On Mon, Nov 17, 2014 at 7:18 PM, Stefan Bucur <stefan.bucur@gmail.com> wrote: programming like
Pylint (which perform checks at lexical and AST level) by going deeper with the code analysis and keeping track of the possible control flow paths in the program (path-sensitive analysis).
Hey, Stefan.
That's great! It's really cool to see more people interested in static analysis with Python. Control flow analysis is missing in Pylint and due to this, we have a couple of false positives. For instance, the following code will emit a raising-bad-type warning, even though exc is later reassigned (but not deduced by the inference engine):
exc = None for i in range(10): try: 1 / 0 break except Exception as e: exc = e else: raise exc
This is very interesting (and a good reminder of the existence of the for/else construct, which I should probably use more often :) ). It would actually be nice to have a suite of such snippets, to be able to benchmark analysis tools more uniformly. Stefan