Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints #328

Open
willfurnass opened this issue Jul 23, 2019 · 0 comments
Open

Add type hints #328

willfurnass opened this issue Jul 23, 2019 · 0 comments

Comments

@willfurnass
Copy link
Collaborator

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 added a commit to willfurnass/MuMoT that referenced this issue Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant