[IPython-dev] ip.core.ipapi.get

Darren Dale dsdale24@gmail....
Wed Sep 30 13:25:09 CDT 2009


On Wed, Sep 30, 2009 at 2:02 PM, Robert Kern <robert.kern@gmail.com> wrote:
> On 2009-09-30 12:43 PM, Darren Dale wrote:
>> My use case is to check in a package's __init__.py to see if it is
>> being imported within an ipython session, and if so to load a custom
>> completer.
>
> Eww.
>
> How about making a macro that imports your package into the namespace and sets
> up the completer? Causing side effects on import like this causes more headaches
> than convenience.
>
> If you are adding completers for particular types, you may want to follow the
> approach I took for the HasTraits completer:
>
>   https://bugs.launchpad.net/ipython/+bug/416174

I'll have a look, thanks for the link. I used the original traits
completer as a template for the h5py completer I mentioned above.

Darren


More information about the IPython-dev mailing list