[IPython-dev] Flat is better than nested

Carlos Córdoba ccordoba12 at gmail.com
Fri May 17 12:19:47 EDT 2013


I agree with Stéfan: removing "frontend" isn't much of a help, because 
it has a compelling and easy meaning to grasp.

For us in Spyder it would be better to be able to import things like 
RichIPythonWidget as

from IPython.frontend.qt import RichIPythonWidget

instead of

from IPython.qt.console.rich_ipython_widget import RichIPythonWidget

because even without "frontend" there are four levels of nested modules 
to reach one of the most essential pieces of that frontend.

So why not add an __all__ attribute to each frontend instead?

Cheers,
Carlos

El 17/05/13 02:44, Stéfan van der Walt escribió:
> On Fri, May 17, 2013 at 2:51 AM, Brian Granger <ellisonbg at gmail.com> wrote:
>> During that discussion we ended up talking about the deep nesting that
>> we have in IPython.frontend
>>
>> Deep inside the notebook frontend, we end up with imports of the sort:
>>
>> IPython.frontend.html.notebook.handlers
>>
>> The qt frontend has similarly deep nesting.
>>
>> To solve this problem, we decided to flatten this out a bit.  Here is
>> what we decided:
>>
>> IPython.frontend.qt -> IPython.qt
>> IPython.frontend.html.notebook -> IPython.html
>> IPython.frontend.terminal -> IPython.terminal
> That seems like a minor saving when measured against the loss of
> structure.  When I see "ipython.frontend.qt" I know exactly what you
> mean, whereas "IPython.qt" doesn't evoke anything specific.  Isn't the
> nesting problem rather deeper down, i.e. under qt, html and terminal?
>
> Stéfan
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130517/5944a4a7/attachment.html>


More information about the IPython-dev mailing list