[IPython-dev] IPython.Extensions on sys.path

Ville M. Vainio vivainio at gmail.com
Wed Nov 1 16:30:20 EST 2006

On 11/1/06, Walter Dörwald <walter at livinglogic.de> wrote:

> Is there a reason why IPython.Extensions is added? Could we drop this in
> the next IPython release?

There is a reason - it makes the modules in the directory easy to
import (import bah instead of from IPython.Extensions import bah), and
we can ship modules there that could also be available as third party
modules (e.g. 'path'). That way, the same code can be used in and out
of ipython (instead of having to type "from IPython.Extensions.path
import path' or even 'from IPython.path import path', which would be
invalid if IPython was not installed).

A case in point - the "pickleshare" module just imports top level
"path", and as such doesn't require IPython to be usable. The module
is available outside IPython, and I didn't feel like "forking" a
version for IPython (or trying to import path both from top level and

One alternative would perhaps be to declare all the stuff in
Extensions as py_modules in setup.py. That way, at least with
setuptools, they would be visible outside the IPython package as top
level modules (yet still reside in the IPython egg directory).

Is there really a problem, apart from the "path" module? If path is
the only problem, we could add 'path' to 'py_modules' and remove it
from Extensions. But the rest should IMHO stay as it is. Many modules
in Extensions are unusable outside IPython anyway.

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

More information about the IPython-dev mailing list