[issue1373762] Tweak pprint.PrettyPrinter.format for subclassing
Kathy Van Stone
report at bugs.python.org
Fri Nov 16 18:00:36 CET 2007
Kathy Van Stone added the comment:
I might be able to give a more compelling example (aside from the fact
wanting it to fit the documentation which implies that one can subclass
the pretty printer). I had a structure containing mostly lists,
dictionary and primitives that I wanted to display, but it also
contained UUIDs. In order to be able to see what the UUID referred to, I
extended the pretty printer to lookup up the name associated with the
UUID and included that. I have it working now by keeping the width
narrow. The patch listed here (moving the line length check inside
lists and dictionaries) doesn't entirely work as my altered
representation of a UUID is different enough from the original that the
calculation of line length is inaccurate.
----------
nosy: +kathyvs
_____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1373762>
_____________________________________
More information about the Python-bugs-list
mailing list