Unidata/netcdf4-python — pull request #291 by shoyer (2014-09-24 22:17:45+00:00)
Title: Use __repr__ instead of __str__

Defining `__repr__` is useful, because consoles like IPython use
it to pretty-print objects.

Python uses `__repr__` to define a default `__str__`, but not the
other way around:
https://docs.python.org/2/reference/datamodel.html#object.__repr__

So this change switches all uses of `__str__` to `__repr__`, to
ensure that users always see reasonable summaries of their data, without
needing to figure out the trick of typing `str(obj)`.

If you like, I would be happy to add tests, but there weren't any already
for `__str__` (and in any case this is 100% backwards compatible).