On Mon, 28 Jun 2021, 12:44 am Nick Coghlan, <ncoghlan@gmail.com> wrote:

For the other proposal, I think you're stuck from a backwards compatibility point of view - the default needs to be the current behaviour, with some way to opt out of using the symbolic str representation.

Although, looking at that problem from a different perspective: the contracts on "str()" and "repr()" under subclassing are *super* weak, since they're primarily designed for consumption by humans.

If consuming code accepts subclasses, but requires them to behave *identically* to the base class, it should either be coercing them to the base class first, or using the better defined string formatting options.

Cheers,
Nick.



Cheers,
Nick.