[IPython-dev] [EXTERNAL] rant: "%matplotlib inline"

Doug Blank doug.blank at gmail.com
Mon Jul 6 13:13:15 EDT 2015


On Mon, Jul 6, 2015 at 1:03 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> On 6 July 2015 at 09:37, MinRK <benjaminrk at gmail.com> wrote:
>
>> I think it should be IPython's responsibility to detect matplotlib's
>> import and register the inline backend.
>
>
> This seems reasonable, but looking at the docs, I realise I'm not actually
> sure how to register a hook to fire after an import. There's plenty of
> machinery for intercepting imports to provide a module in some other way,
> but nothing obvious for detecting that an import has happened. PEP 369,
> post import hooks, was withdrawn years ago.
>
> I guess we'd need to override __import__(), but that feels rather wrong.
>

Can this be solved in a manner that could also work for other kernels? Not
the exact same code, but a general principle.

Perhaps thinking of it as a general "handshaking" issue... the kernel and
the initiating front need to have a conversation about a variety of
settings, and the result is the understanding of what format certain things
will take.

Maybe a general %setup or %config concept could be used.

-Doug


>
>
> Thomas
>
> _______________________________________________
> 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/20150706/f19bc42e/attachment.html>


More information about the IPython-dev mailing list