On Mon, Dec 19, 2022 at 01:02:02AM -0600, Shantanu Jain wrote:

> collections.UserString can take away a lot of this boilerplate pain from
> user defined str subclasses.

At what performance cost?

Also:

>>> s = collections.UserString('spam and eggs')
>>> isinstance(s, str)
False

which pretty much makes UserString useless for any code that does static 
checking or runtime isisinstance checks.

In any case, I was making a larger point that this same issue applies to 
other builtins like float, int and more.


-- 
Steve
_______________________________________________
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/UYRYTKMO3L5GSB2F5A4N5I6J3LTA7DQE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to