[IPython-dev] Autoload brainstorming

Ville M. Vainio vivainio at gmail.com
Thu May 24 15:40:19 EDT 2007


Sorry for spamming the lists, but I'm kinda on the flow here ;-)

I was thinking of how to implement the autoloading, and namely
autoload registry. I believe we could add a greppable block to the
modules that would be executed by IPython on "scanning" phase (without
having to import the module).

I.e. ipy_pydb.py extension would have the block:

"""
<ipython_scan>

ip.autoload("pydb", "ipy_pydb")

# ok, this is artificial in ipy_pydb, but for the sake of example..
ip.autoload("bzr", "ipy_app_completers")
</ipython_scan>
"""

Then we would have an autoload registry (in _ip.db) that is consulted
when we see "%pydb bah" or "%pydb <tab>", to see what module will be
imported before magic execution or tab completion will "work".

I would only want to list the "autoloadable" magics (as opposed to
already loaded magics) in tab completer when the user has started
typing the magic name with %.

This should seriously unbloat IPython, while allowing intoduction of
zillions of magics.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'



More information about the IPython-dev mailing list