Static Type Analysis for Python

Tiancong Dong,Lin Chen,Zhaogui Xu,Bin Yu
DOI: https://doi.org/10.1109/WISA.2014.20
2014-01-01
Abstract:Python is a kind of dynamic-typed language which provides flexibility but leaves the programmer without the benefits of static typing. This paper describes Type, a tool that works for static type annotation and inference for python. It could simulate the built-in modules, transform the Python source code to IR(Intermediate representation) which we design and annotate, infer and reduce the IR into the type system. Type could provide the explicit type information, detect the type errors at compile time and improve the efficiency of development and the accuracy of point-to analysis. By the evaluation of applying Type to a suite of benchmarks, we find that Type can annotate and infer the types with a good precision and coverage in accept time.
What problem does this paper attempt to address?