python-template
python-template copied to clipboard
Type hints support
For library users it is beneficial if typings in the library are available. It will make writing code in an IDE much richer and less error prone. Having typing from the start will help library developers take typings into account.
Adding support could involve:
- [ ] Typings in my_module.py with docstring without types
- [ ] Include
py.typedfile besides my_module.py, see PEP-561 - [ ] Command to check typings are correct, for example
mypyorpytypeorpyreorprospector[with_mypy]orpytest-mypy - [ ] Show types in api docs, see for example
sphinx-autodoc-typehints - [ ] Run static type check on CI
- [ ] Optionally, use runtime type checking with typeguard
The linter rules might need adjusting if typing feature is included.
The Python chapter in the guide also needs to be updated to recommend type hints