[IPython-User] Configure number formatter for integers?

Tobias Nöbauer tobias.noebauer@gmail....
Thu Mar 22 10:55:56 CDT 2012


Hi all,

I'm trying to make IPython 0.12 format large integers as '%g', i.e. in
floating point notation (I end up counting 0's all the time). I've
tried to configure c.PlainTextFormatter.type_printers and specify a
callable for the int type that does the job, like so (in
ipython_config.py):

c.PlainTextFormatter.type_printers = {
type(1): (lambda x: '%g' % x)
}

However, ipython tells me that this callable needs to take 3 arguments
as soon as I try to output an integer. Any clues where I can find docs
on the callable signature required here? Or am I on the wrong track?
Any clues?

Thanks,
Tobias


More information about the IPython-User mailing list