Does python have an equivalent java Preconditions library. eg
in java, you can check the parameters as follows:
public void dummymethod(Cat a, Dog b) { Preconditions.checkNotNull(a, "a can not be null."); Preconditions.checkNotNull(b, "b can not be null."); }
If a or b is null, Java throws a Runtime Exception, but what about python, which works best for python?
source share