[IPython-dev] Flat is better than nested

Fernando Perez fperez.net at gmail.com
Mon May 20 17:00:04 EDT 2013


On Fri, May 17, 2013 at 12:51 PM, Carlos Córdoba <ccordoba12 at gmail.com> wrote:
> Ok, thanks for the answer, that makes more sense (although I don't agree
> with making such changes so far ahead in time).

One more reason that explains the reasoning behind this: if we really
want to end up with less nested public APIs (which goes on top of your
suggestion of better __all__ support), the frontend level didn't
really add anything.  We can't in frontend/__init__ import anything
from the subpackages, because a notebook user most certainly won't
want Qt libraries pulled in, and similarly you guys probably don't
want tornado to become a dependency for Spyder :)

So the frontend/ level was serving one purpose only: informing users
of the code, by aggregation in the filesystem, that html, terminal and
qt are our three frontends.  While there's certainly some value to
this, there's also a cost in deeper nesting and the above constraint.
It just seemed like flattening was a better tradeoff in this case,
since most library users (e.g. sypder) will know anyways that
IPython's qt directory is really for the qt console, since it's not
like we ship entire pieces of Qt widgets or anything similar.

We realize this represents a small loss of information at the
filesystem layout level, but it was a worthwhile tradeoff in terms of
the rest of our package management and API constraints.

I hope this clarifies things.

Cheers,

f



More information about the IPython-dev mailing list