[IPython-dev] Extensible pretty-printing

Fernando Perez fperez.net@gmail....
Thu Oct 28 17:41:27 CDT 2010


On Thu, Oct 28, 2010 at 2:16 PM, Robert Kern <robert.kern@gmail.com> wrote:
> Yes. The original pull request just tried to restore the status quo
> anterefactor. It happened to use the CommandChainDispatcher because that was the
> extensible API at the time. Since the larger issue of what the extensible API
> *should* be was raised, I am now proposing that we should use pretty.py and
> expose it as the API for people to extend the string representation used in the
> displayhook.

OK, it all makes sense now.  Having looked at extensions/pretty in
more detail now, I'm happy following through with your suggestion,
modulo perhaps updating to the most current pretty if we have a stale
one (I  didn't check yet).

One last question: we don't want anything actually *printing*, instead
we want an interface that *returns* strings which we'll  stuff on the
pyout channel (an in-process version can simply take these values and
print them, of course).  Right now we only have a single
representation stored in the 'data' field.  How do you think we should
go about the multi-field option, within the  context of pretty?

Cheers,

f


More information about the IPython-dev mailing list