- Use type hints.
- Follow the PEP8 styleguide.
- Write docstrings in Numpy format, with a few tweaks:
- Use "Arguments" instead of "Parameters".
- Don't use space before
:
in the type specification. Sphinx and VSCode render it the same, and it's closer to the signature.
- Document each class attribute immediately after its declaration (example)
- When in doubt, lean in the direction of verbosity and readability.