make doctests pass with __repr__