In the interpreter you can just write the name of an object e.g. a list a = [1, 2, 3, u\"hellö\"] at the interpreter prompt like this:
a = [1, 2, 3, u\"hellö\"]
>>&
print(variable) equals to print(str(variable))
print(variable)
print(str(variable))
whereas
variable equals to print(repr(variable))
variable
print(repr(variable))
Obviously, the __repr__ and __str__ method of the object h5file produce different results.
__repr__
__str__
h5file