[issue16801] Preserve original representation for integers / floats in docstrings

Terry J. Reedy report at bugs.python.org
Sat Feb 23 21:27:20 CET 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue16801>
_______________________________________


More information about the Python-bugs-list mailing list