Terry J. Reedy added the comment:

Serhiy called subclassing 'particular and cumbersome'.
'Cumbersome' is an opinion. I consider subclassing elegant. The ease of doing 
so and specializing only what one needs to is a major feature of Python. It 
only took me a couple of minutes to whip up solutions for two different cases.

I think 'particular' is wrong. Subclassing is a general solution for a 
particular class of values. As I illustrated, it results in the value getting 
its custom representation *everywhere*. Other solutions seem to give it its 
custom representation only in the particular context of standard signature 
displays, and its 'regular' not-so-good representation when directly accessed. 
To me, that is much worse.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16801>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to