On 20/12/2022 09:16, Steven D'Aprano wrote:
On Mon, Dec 19, 2022 at 05:53:38PM -0800, Ethan Furman wrote:
Personally, every other time I've wanted to subclass a built-in data type,
I've wanted the built-in methods to return my subclass, not the original
class.
Caveat: If you were subclassing str, you would probably want __str__ and
__repr__ (if you were not overriding them) to return plain strings.
Best wishes
Rob Cliffe
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/J4QUX4BT2MN5HAWKXV2FLPTENE5RFR3E/
Code of Conduct: http://python.org/psf/codeofconduct/