Open
Description
I find three ways to increase the robustness of the code:
-
Add assertion at the beginning and at then end of functions:
This can help to debug the code and the assertion can be remove with the option -O or -OO of python.
The only inconvenient, at this option is that the user need to know the existence of this option of python. -
Add type to argument of functions:
There is some recommendation here.
I don't really like this way because types in python become less readable. -
Choose only critical test to do and raise the associate error (see Policy for testing types of input parameters #61).