illinois / clickin

Open Source Polling App
University of Illinois/NCSA Open Source License
14 stars 44 forks source link

Consider type-checking Python code #25

Open benpankow opened 5 years ago

benpankow commented 5 years ago

We should consider using a static type checker and PEP 484 type hints in our codebase.

There are a few benefits to using type annotations for function signatures - they help self-document the codebase as it grows, and they help catch type errors which may introduce bugs into our code.

While type hints are a built-in part of the Python language, Python doesn't validate the correctness of these types. This is where a static type checker would be useful, which could be run during development and by CI at PR time. The de-facto standard is mypy, but pyre is also an option.