Closed layday closed 4 years ago
I think this is a good idea. I've used mypy before and it worked well.
The latest version of Pyright is able to assess a library's type completeness. That is, it identifies public attributes which are not typed or only partially typed and calculates a 'completeness score'. You can read more about this feature here. I ran this on the Questionary codebase and it gave it a completeness score of 20.5%. However, this is slightly deceptive because it deducts every occurrence of an untyped attribute from the score, e.g. Choice
is counted repeatedly because it has five public attributes which are not explicitly typed: disabled
, title
, checked
, value
and shortcut_key
. Please see the output of pyright --verifytypes questionary
below. (This is not the same thing as type checking Questionary itself but I thought it might be of interest.)
I wonder if there would be any interest in adopting a type checker. Questionary appears to be extensively annotated so this shouldn't prove too onerous. The four established type checkers are mypy, Pyright, pytype and pyre - would you have a preference for one of those?