[IPython-dev] Flat is better than nested

Carlos Córdoba ccordoba12 at gmail.com
Fri May 17 15:51:54 EDT 2013


Ok, thanks for the answer, that makes more sense (although I don't agree 
with making such changes so far ahead in time).

But what about my proposal of an __all__ attribute? That would make 
IPython consumer lives much easier and pleasant.

Cheers,
Carlos

El 17/05/13 11:53, Brian Granger escribió:
> A few points:
>
> * The html.notebook level are redundant.  We will only have 1 html frontend.
> * We have an eye to split off our different frontends as separate
> projects in the future.  They are much too unstable at this point to
> do that, but this move to bring html/qt/terminal to the top level
> reflects that direction of thinking - they are of top level
> importance.
>
> Cheers,
>
> Brian
>
> On Fri, May 17, 2013 at 9:19 AM, Carlos Córdoba <ccordoba12 at gmail.com> wrote:
>> 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
>>
>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>
>




More information about the IPython-dev mailing list