[IPython-dev] Extensible pretty-printing

Robert Kern robert.kern at gmail.com
Thu Oct 28 23:04:31 EDT 2010


On 2010-10-28 20:31 , Brian Granger wrote:
> I am in the middle of lab (they are taking a quiz), so I don't have
> time to dig into the full thread ATM, but I do have a few comments:
>
> * The main thing that I am concerned about is how we answer the
> question i) "how do I (a developer of foo) make my class Foo, print
> nice HTML/SVG.  IOW, what is does the public API for all of this look
> like?

Depends on how you write the HTMLFormatter and SVGFormatter. We can probably 
write a general base class that handles looking for _html_() methods and to 
allow registration of functions for types that cannot be modified. I've broken 
out the deferred type-dispatching I use in our pretty.py before; I'll try to 
find it.

-- 
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 IPython-dev mailing list