MuMoT icon indicating copy to clipboard operation
MuMoT copied to clipboard

Add type hints

Open willfurnass opened this issue 6 years ago • 0 comments

As of Python 3.5 one can annotate function definitions with the types of parameters and return values: https://docs.python.org/3/library/typing.html

Benefits of including type hints in Python code:

  • A better understanding of what a function does can be gained from reading just the function declaration.
  • Static type checking tooling e.g. mypy can warn of type incompatibilities, saving you from discovering type issues at runtime. Many IDEs now include mypy support (e.g. VS Code)
  • Tooling exists to insert typing info into API docs, negating the need to include type info as essentially free text in docstrings.

I think MuMoT would benefit from adopting type hints

willfurnass avatar Jul 23 '19 16:07 willfurnass