by Andrey Vlasovskikh for
Static analysis is a method of making statements about the program based on its source code without actually running it. We will look at static analysis tools available for Python (PyLint, PyFlakes, Pep8, inspections in IDEs) and discuss what kinds of problems they can discover automatically in your source code. These tools can be used on a daily basis in order to reduce the amount of run-time errors and exceptions, and to discover code smells and code style discrepancies.
We will also look at how these tools are implemented internally, and walk through the steps they use to analyze Python code: lexing, parsing, reference resolution, type inference and so on. We will also discuss the problems that are caused by the dynamic nature of Python and the strategies used by static analysis tools for dealing with it.