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

Ville M. Vainio vivainio@gmail....
Mon Feb 2 07:07:31 CST 2009


On Sun, Feb 1, 2009 at 2:13 AM, Darren Dale <dsdale24@gmail.com> wrote:

> Thank you for the advice. I've been looking at this most of the day, and I
> think I'm stuck. I have an object I'm trying to navigate:

> It's not clear to me how I would get the object at level_3 and then hook
> into ipython's usual completion chain to filter attributes with leading
> underscores, or the traits completer, for example. Is this possible?

You just need to eval the whole thing, and see what attributes that
eval'ed object has. That's what I did in ipy_greedycompleter. It's
sort of "complete at your own risk" scheme, but it's the best thing
you can get without putting in lots of work (and it will do what you
want anyhow). The only work you need to do is determine how much you
need to eval (here, it's everything before period).


-- 
Ville M. Vainio
http://tinyurl.com/vainio


More information about the IPython-dev mailing list