On Mon, 28 Jun 2021, 12:44 am Nick Coghlan, <ncogh...@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.
>
>
>
>
>
>>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/WGL6EFHZAYKQ7RCYINCO6M7PJ4Y5HK7V/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to