Python 3 Types in the Wild: A Tale of Two Type Systems
Wed 18 Nov 2020 13:20 - 13:40 at SPLASH-III - 3 Chair(s): Patrick Cousot, Michael Homer
Python 3 is a highly dynamic language, but it has introduced a syntax
for expressing types with PEP484. This paper explores how
developers use these type annotations, the type system semantics
provided by type checking and inference tools, and the performance
of these tools. We evaluate the types and tools on a corpus of public
GitHub repositories. We review MyPy and PyType, two canonical static
type checking and inference tools, and their distinct
approaches to type analysis. We then address
three research questions:
(i) How often and in what ways do developers use Python 3 types?
(ii) Which type errors do developers make?
(iii) How do type errors from different tools compare?
Surprisingly, when developers use static types, the code rarely
type-checks with either of the tools. MyPy and PyType exhibit false
positives, due to their static nature, but also flag many useful
errors in our corpus. Lastly, MyPy and PyType embody two distinct type
systems, flagging different errors in many cases.
Understanding the usage of Python types can help guide tool-builders
and researchers. Understanding the performance of popular tools can
help increase the adoption of static types and tools by practitioners,
ultimately leading to more correct and more robust Python code.
Wed 18 Nov Times are displayed in time zone: Central Time (US & Canada) change
13:00 - 14:20: 3SAS / DLS 2020 at SPLASH-III +12h Chair(s): Patrick CousotNew York University, Michael HomerVictoria University of Wellington | |||
13:00 - 13:20 Research paper | Exact and Linear-Time Gas-Cost Analysis SAS Pre-print | ||
13:20 - 13:40 Talk | Python 3 Types in the Wild: A Tale of Two Type Systems DLS 2020 Ingkarat Rak-amnouykitRensselaer Polytechnic Institute, Daniel McCrevanRensselaer Polytechnic Institute, Ana MilanovaRensselaer Polytechnic Institute, Martin HirzelIBM Research, Julian DolbyIBM Research, USA Link to publication DOI Pre-print Media Attached | ||
13:40 - 14:00 Research paper | On Multi-Language Abstraction: Towards a Static Analysis of Multi-Language Programs SAS Samuele BuroUniversità degli Studi di Verona, Roy CroleUniversity of Leicester, Isabella MastroeniUniversity of Verona, Italy File Attached | ||
14:00 - 14:20 Talk | Wasm/k: Delimited Continuations for WebAssembly DLS 2020 Donald PinckneyNortheastern University, Arjun GuhaUniversity of Massachusetts at Amherst, Yuriy BrunUniversity of Massachusetts Amherst Link to publication DOI Pre-print Media Attached |