[IPython-user] A corner-case where ipython fails, and a feature idea

Abel Daniel abli at freemail.hu
Thu Nov 17 14:43:19 CST 2005


(Although I am subscribed to the ipython-user list, I don't usually
read it, so this might have been mentioned before, in which case I'm
sorry for the repetition.)

I'm not sure this is a bug, but I was a bit suprised when I noticed it:

abli at hooloovoo:~$ ipython
Python 2.3.4 (#2, Sep 24 2004, 08:39:09) 
Type "copyright", "credits" or "license" for more information.

IPython 0.6.15 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]:[].sort?
Type:		list
Base Class:	<type 'list'>
String Form:	[]
Namespace:	Interactive
Length:		0
Docstring:
    list() -> new list
    list(sequence) -> new list initialized from sequence's items


In [2]:l=[];l.sort?
Object `l=[];l.sort` not found.

In [3]:l=[]

In [4]:l.sort?
Type:		builtin_function_or_method
Base Class:	<type 'builtin_function_or_method'>
String Form:	<built-in method sort of list object at 0xb7a4bd8c>
Namespace:	Interactive
Docstring:
    L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1


And the feature idea: currently the following fails:
In [5]:import?
Object `import` not found.

I guess it would be nice if one could get basic information about
statements, like 'import', 'if', etc. with 'statement?'. Although such
might be superflous for seasoned pythoneers, it could be helpful for
beginners.

--
Abel Daniel
abli at freemail.hu




More information about the IPython-user mailing list