Python __repr__ function should not print anything to the console, it should just return an internal representation of the instance, that can ideally be processed.
In the same way, __str__ should not call print either, just return the string that's is going to be printed when user calls print on the object!
Many objects in h2o, also implement show: this methods is used to print complex objects.
Although, it seems to serve the same goal as print(obj).
We can keep it for backwards compatibility but the printable string of an instance should be the result of __str__ implementation, so that:
Among the side effects of this:
in IPython/Jupyter instance details are printed when inspecting method using inst.method?, inst.method??.
for debugging, for example when printing request results, we don't have the choice between printing repr() or str() (default), so that it prints some of its nested values BEFORE its keys... making this unreadable, non-parsable...
As a default implementation for __repr__ in H2O classes, I would suggest something like: