-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use Python type hints #690
Comments
A few tools have been mentioned that can help by (semi)automatically generating the type annotations:
|
There is also a pytest-monkeytype plugin that can be used with monkeytype for recording the variable types. |
As instructed, I run Then I run PEP563 is for solving two problems:
These changes by monkeytype can be used as a starting point for manual editing. |
Since Python 3.5 it has been possible to add type hints for variables and function/method signatures (PEP 484).
We should do this within the Annif codebase as well. Here is a good basic tutorial about the available types and how to use them. Quoting from the post:
Eventually we should also enforce the type hints with mypy, but let's leave that out of scope for this issue so that it can be closed once we have the hints in place at least for a reasonable proportion of the codebase.
The text was updated successfully, but these errors were encountered: