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

Thomas Kluyver takowl at gmail.com
Mon Jul 6 13:03:10 EDT 2015


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.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150706/c910929a/attachment.html>


More information about the IPython-dev mailing list