When you
If you make your own class and don't provide either method, you'll get that odd default string.
Exception objects have a
print()
an object, it will generally look for a __str__()
method of that object. You should only get a print of the object's address for objects that don't have a __str__
method, or in its absence, a __repr__
method.If you make your own class and don't provide either method, you'll get that odd default string.
Exception objects have a
__str__
method, so that is what is printed. For them, it prints out the passed in information.