<br><br><div class="gmail_quote">On Sat, Oct 22, 2011 at 1:36 PM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 10/22/11 6:58 PM, Warren Weckesser wrote:<br>
><br>
><br>
> On Sat, Oct 22, 2011 at 12:49 PM, Warren Weckesser<br>
</div><div><div></div><div class="h5">> <<a href="mailto:warren.weckesser@enthought.com">warren.weckesser@enthought.com</a> <mailto:<a href="mailto:warren.weckesser@enthought.com">warren.weckesser@enthought.com</a>>> wrote:<br>
><br>
> Hi all,<br>
><br>
> ipython is doing some magic with the output of 'type(a)' (using 0.11.rc1 in<br>
> EPD):<br>
><br>
> In [1]: a = 1<br>
><br>
> In [2]: type(a)<br>
> Out[2]: int<br>
><br>
> In [3]: str(type(a))<br>
> Out[3]: "<type 'int'>"<br>
><br>
> In [4]: repr(type(a))<br>
> Out[4]: "<type 'int'>"<br>
><br>
> The output in line 2 is nicer, but it makes it appear that the builtin<br>
> 'type' behaves in a way that it does not. My attempts (possibly too brief)<br>
> to find documentation or discussion of this feature have not been fruitful.<br>
> Can anyone point me to the relevant docs, or mailing list discussions? Thanks.<br>
><br>
><br>
><br>
> Of course, three minutes after sending that email, I find the '%pprint' command<br>
> for toggling pretty-printing. That's enough to answer my question.<br>
<br>
</div></div>The default pretty-printers are defined starting here:<br>
<br>
<a href="https://github.com/ipython/ipython/blob/master/IPython/lib/pretty.py#L463" target="_blank">https://github.com/ipython/ipython/blob/master/IPython/lib/pretty.py#L463</a><br>
<br>
These were the defaults for the upstream, third-party pretty.py (with a just a<br>
bug-fix for the re objects, IIRC). I happen to like this one, but if there is a<br>
consensus that it is more confusing than pretty, I'm happy to consider changing it.<br></blockquote><div><br><br>It's fine by me, now that I know it is just one of the pretty-printing hooks. <br><br>Warren<br><br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font color="#888888"><br>
--<br>
Robert Kern<br>
<br>
"I have come to believe that the whole world is an enigma, a harmless enigma<br>
that is made terrible by our own mad attempt to interpret it as though it had<br>
an underlying truth."<br>
-- Umberto Eco<br>
</font><div><div></div><div class="h5"><br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</div></div></blockquote></div><br>