[Python-ideas] pprint in displayhook

Robert Kern robert.kern at gmail.com
Tue Oct 1 22:00:27 CEST 2013


On 2013-10-01 20:17, Paul Colomiets wrote:
> Hi,
>
> On Sun, Sep 29, 2013 at 11:38 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
>>
>> What should be changed in pprint?
>
> Would be nice if it support custom types.

For what it's worth, I would like to point out that IPython uses an adaptation 
of Armin Ronacher's pretty.py for pretty-printing as the default displayhook. It 
is a nice design that supports custom types after-the-fact.

   https://github.com/ipython/ipython/blob/master/IPython/lib/pretty.py

Armin's original code:

   http://dev.pocoo.org/hg/sandbox/file/tip/pretty/pretty.py

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco



More information about the Python-ideas mailing list