Python probabilistic type inference with natural language supportDownload PDFOpen Website

Published: 2016, Last Modified: 23 Mar 2024SIGSOFT FSE 2016Readers: Everyone
Abstract: We propose a novel type inference technique for Python programs. Type inference is difficult for Python programs due to their heavy dependence on external APIs and the dynamic language features. We observe that Python source code often contains a lot of type hints such as attribute accesses and variable names. However, such type hints are not reliable. We hence propose to use probabilistic inference to allow the beliefs of individual type hints to be propagated, aggregated, and eventually converge on probabilities of variable types. Our results show that our technique substantially outperforms a state-of-the-art Python type inference engine based on abstract interpretation.
0 Replies

Loading