6
Is there any good practice, standardization, recommendation, etc. aimed at preventing invalid types from being passed to methods and functions?
If I am working alone is more quiet, I even wrote the method so I know what types of parameters he expects to receive, but I see a problem when the development becomes a team. How will a third party know if for a given method he must pass an integer or a string, if it must be a list, or any other object? Only at execution time?
The only trick I see is to make massive use of docstrings and use an editor to display the docstring when writing a call to a method.
Any alternative other than this?
Possibly,
mypy
.– Woss