On Mon, 18 Jul 2016 01:58 am, Steven D'Aprano wrote: > All objects > can be coerced to strings, using either str() or repr(). If you define > only one of __str__ or __repr__, Python will use the other.
Er, sorry, that was incoherent. I hit Send too quick, without editing. What I meant to say was, if you *fail* to define both __str__ and __repr__, Python will use whichever you define in place of the missing one. And of course, if you define neither, then you will inherit from object. -- Steven “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list