3 ms·
This is what comment blocks are for. Putting the return type in the funcfions docstring should be a requirement during linting, and ensuring the correct type is
by Thorentis 4y ago
This is what comment blocks are for. Putting the return type in the funcfions docstring should be a requirement during linting, and ensuring the correct type is used should be part of PR review. Easy to find, easy to read, no static type checker required.
- manfre 4y agoEnsuring consistency and long term accuracy of the docstring is more effort and more verbose than type annotations.
- a4a4a4a4 4y ago> Putting the return type in the funcfions docstring should be a requirement during linting, and ensuring the correct type is used should be part of PR review. You're suggesting pushing the types from the function signature + docstring into only the docstring, so that we can offload the static type-checking from mypy to the reviewers of the PR? Why? This is at best exactly as good as mypy (100% accurate and repeatable) and at worst (and most likely) will lead to human reviewers making mistakes/not catching edge cases/forgetting to update docstrings.
- noitpmeder 4y agoIf I interviewed a python developer and he said anything close to what your post contains I would veto them on the spot.