[IPython-dev] requesting guidance with a custom completer for a dictionary-like object

Darren Dale dsdale24@gmail....
Mon Jan 12 07:20:26 CST 2009


Please excuse me for bumping this one time. Can anyone offer some guidance
on implementing a custom completer for getitem access?

On Sun, Dec 14, 2008 at 6:07 PM, Darren Dale <dsdale24@gmail.com> wrote:

> Hello,
>
> I am working on a custom completer for h5py, which provides a nice
> interface to hdf5 files with a dictionary-style interface. I would like to
> enable tab completion for these h5py objects (which share a common ancestor
> called _DictCompat), but I am testing with regular dictionaries.
>
> If I have:
>
> d={'a':{'b':1},'b':2}
>
> I can currently do:
>
> d['<tab>
>
> and get
>
>   a     b
>
> if I do:
>
> d['a<tab>
>
> I would like to get:
>
> d['a']
>
> but I get
>
> d['a'
>
> and then if I do
>
> d['a'<tab>
>
> I get
>
> d['a'a
>
> Also, it is common to have deeply nested hierarchies with h5py, so I would
> like to be able to do:
>
> d['a'].<tab>
>
> or
>
> d['a']['<tab>
>
> I think I remember hearing that IPython used to do tab completion of
> dict-like objects, but the feature was removed because it was causing
> problems with user code. I was hoping someone might remember how this could
> be done, and could provide some guidance.
>
> Thanks,
> Darren
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-dev/attachments/20090112/f667ef7d/attachment.html 


More information about the IPython-dev mailing list