
Dec. 24, 2022
1:31 a.m.
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