[IPython-dev] Output of, e.g., type(a)

Warren Weckesser warren.weckesser@enthought....
Sat Oct 22 12:58:57 CDT 2011


On Sat, Oct 22, 2011 at 12:49 PM, Warren Weckesser <
warren.weckesser@enthought.com> wrote:

> Hi all,
>
> ipython is doing some magic with the output of 'type(a)' (using 0.11.rc1 in
> EPD):
>
> In [1]: a = 1
>
> In [2]: type(a)
> Out[2]: int
>
> In [3]: str(type(a))
> Out[3]: "<type 'int'>"
>
> In [4]: repr(type(a))
> Out[4]: "<type 'int'>"
>
> The output in line 2 is nicer, but it makes it appear that the builtin
> 'type' behaves in a way that it does not.  My attempts (possibly too brief)
> to find documentation or discussion of this feature have not been fruitful.
> Can anyone point me to the relevant docs, or mailing list discussions?
> Thanks.
>


Of course, three minutes after sending that email, I find the '%pprint'
command for toggling pretty-printing.  That's enough to answer my question.

Warren




>
> Warren
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20111022/dc892348/attachment.html 


More information about the IPython-dev mailing list