[IPython-user] IPython tab-completion behaviour in Linux

Fernando Perez fperez.net@gmail....
Mon Aug 3 16:57:36 CDT 2009


Hi Gokhan,

On Sun, Jun 28, 2009 at 10:43 PM, Gökhan SEVER<gokhansever@gmail.com> wrote:
> I am wondering whether not getting attributes or models of some empty
> objects in the right way is a pre-defined behaviour or not? For
> example when I do "". and hit the tab instead of getting a list that
> is associated with the string object I get a list of hidden files in
> the current working directory. However in the []. case if I explicitly
> write sort I can see that a list object has a sort method.
>
> Is this an Ipython bug or could be fixed somehow?

Sorry for not replying earlier... The reason for this is that we avoid
evaluating the user input before tab completing, because doing so
would have many potentially problematic side effects.  We query the
namespace, so if you do

foo.bar.<tab>

we look for 'foo.bar' in your namespace, but we don't do
eval('foo.bar') at all.  Since '{}' is not in your namespace, it isn't
found, and the next available completer (for files) tries to fill in.

Early in its life ipython used to eval() user input before completion,
and that was the source of many problems, so it has been removed.

Is that clear?

Cheers,

f


More information about the IPython-user mailing list