[IPython-dev] looking for advice on a custom dict-like completer

Darren Dale dsdale24@gmail....
Fri Feb 6 09:21:01 CST 2009


On Fri, Feb 6, 2009 at 3:10 AM, Fernando Perez <fperez.net@gmail.com> wrote:

> On Wed, Feb 4, 2009 at 9:41 AM, Ville M. Vainio <vivainio@gmail.com>
> wrote:
>
> > I like to think of it as a place to put extensions that are not
> > coupled to ipython release cycle - think of it as 'contrib' folder.
> > In addition to allowing independent release cycle, it can be faster to
> > put stuff 'in-development' extensions there, since there are no
> > centralized quality requirements (no unit tests needed) - code is
> > released "with the hope that it will be useful".
> >
> > It's also easier to tell users to pull a new version
> > ipython-extensions than to ask them to upgrade their ipython
> > installation (which may come from their linux distribution).
>
> It's worth noting that if Darren is willing to add tests/docs for it,
> I'd be happy to have it in ipython proper.  But we are trying to be
> serious about not committing any code without docs and tests into the
> core, so in the end it's your choice, Darren, of where to send it.
>

I submitted the h5py completer to the author of h5py, he is considering
including it in h5py-1.1. I think it might make more sense for it to be
distributed as a part of h5py. Do you think ipython is a better home for it?

I hadn't really intended to continue work on the ipy_dict_completer, I was
only using it as a stepping stone, but it might be a good candidate for
inclusion in ipython at some point. It was easy enough to implement the
items completer for h5py since it only accepts strings for the keys. For a
regular dict that can use any hashable object as a key, it should be
possible to check the user namespace for possible completions, and then
filter that list based on whether those objects appear as keys in the dict
being completed. Although, I can imagine entanglements like:

dict_a = {11:'eleven'}
dict_b= {12: dict_a}

dict_a[dict_b[dict_<tab>

which might be simple enough to do with recursive calls, but I've never
gotten an answer on whether or not it is possible to hook back into the
standard ipython completion pipeline from within a completer. Plus, I really
need to use the time I have available to work on my physical quantities
package, which is nearly ready to submit to numpy-discussion for comments. I
think I'd rather submit the dict completer to ipython-extensions for now, in
case anyone would like to put the finishing touches on it.

Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-dev/attachments/20090206/e7e187e4/attachment.html 


More information about the IPython-dev mailing list