self._format(object.foo, stream, indent, allowance + 1, context, level)
self._format(object.bar, stream, indent, allowance + 1, context, level)
stream.write(')')
_dispatch[YourType.__repr__] = _pprint_yourtype
How can I make my class pretty printable in Python?