Maybe a little bug of ipython 0.7.3 ?

Fernando Perez fperez.net at gmail.com
Mon Jan 8 22:53:03 CET 2007


fdu.xiaojf at gmail.com wrote:

> I'm new to ipython, and i found it a very cool product.

Glad you like it, though in the future I recommend you post on the ipython
list.  I very rarely scan c.l.py these days, unfortunately.

> $ ipython
> Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
> Type "copyright", "credits" or "license" for more information.
> 
> IPython 0.7.3 -- An enhanced Interactive Python.
> <snip>
> 
> In [8]: a = range(1000)
> 
> In [9]: a?
> Type:           list
> Base Class:     <type 'list'>
> String Form:    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
> 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 <...> 0, 981, 98
> 2, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996,
> 997, 998, 999]
> Namespace:      Interactive
> Length:         1000
> Docstring:
>     list() -> new list
> list(sequence) -> new list initialized from sequence's items
> 
> *Please note that there is an extra "0" after "**26 <...>", which
> doesn't appear for the followling cases:*

The 'foo?' feature just gives you a summary of information about an object,
and for very long strings, it truncates them in the center, printing only

head<...>tail

where head and tail are each about 100 characters long.

What you are seeing is just an accident of where the truncation happens,
that '0' is the last digit in 980 :)

Cheers,

f




More information about the Python-list mailing list