[Python-ideas] pprint in displayhook

Bruce Leban bruce at leapyear.org
Fri Sep 27 19:02:43 CEST 2013


It's a great idea to be able to do this. Fortunately, you already can.
Changing the Python default is a terrible idea for all the other reasons
people mentioned, not least of which is the fact that pprint doesn't work
for all inputs.

I suggest writing a recipe that provides a pprint-ish replacement for repr.
I suggest producing results that are identical to repr with only two
exceptions: (1) adding whitespace, (2) adding line breaks to strings. While
I would never add this by default, there are certainly times where I would
prefer prettier output.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130927/38965625/attachment.html>


More information about the Python-ideas mailing list