ipython/ipython — Issue #1404: Feature Request: List/Dictionary tab completion
Author: cruser42
Created: 2012-02-13 21:19:23+00:00
State: open

Hi Everyone,

I LOVE the ipython tab completion, but.....Is there a way to coax ipython into offering class methods and variables when the class is an item in a list or hash?

Elaboration:

If I have

In [6]: mylist=['a',1,5]

I can clearly do:

In [7]: mylist[0].capitalize()
Out[7]: 'A'

but, if I type in

mylist[0].

and hit TAB, ipython is unable to suggest reasonable completion options. I can rectify that by doing:

In [8]: myitem=mylist[0]

and then hitting tab after typing:

In [9]: myitem.

What I'm looking for is a way to avoid saving the list entry into a variable because that can get frustrating when you would have to do it 2-3 times for cases like:

a.c[0].d['e']['f'].p.q

Thanks!