Type hints usage in Python projects

Many developer communities strongly adhere to certain naming conventions. A common idiom in dynamically-typed languages is to name method arguments (i.e., formal parameters to methods) after their expected type.

Example: in Python the practice is to annotate a method argument in a specific manner, e.g., name: String, or to name a variable str if the expected object is of type String.

The aim of the project is to have a closer look into type hints usage in Python, in order to determine how prevalent this usage is, and whether some specific patterns can be extracted.

Research Questions

  • Is it possible to accurately predict a variable’s type by statically analysing its name? (What is the accuracy of naive approaches? How common are false positives?)
  • How are type hints used idiomatically? Can some kinds of patterns be extracted?

Contact: Nevena Milojković

Last changed by admin on 21 April 2009