[IPython-dev] Reloading compiled modules in a notebook

Robert Kern robert.kern at gmail.com
Wed Mar 19 08:00:36 EDT 2014


On 2014-03-19 11:26, Tiago Antao wrote:
> On Wed, 19 Mar 2014 12:16:45 +0100
> Austin Bingham <austin.bingham at gmail.com> wrote:
>
>> Ah, it appears you're right. I should have checked this first. Thanks
>> for helping me sort this out.
>
> I think Python 3 allows you to reload modules:

Not extension modules.

> http://docs.python.org/3/library/imp.html#imp.reload
>
> and, since 3.4
>
> http://docs.python.org/3/library/importlib.html#importlib.reload

"The init function of extension modules is not called a second time."

"In many cases, however, extension modules are not designed to be initialized 
more than once, and may fail in arbitrary ways when reloaded."

> Of course 2 might be a completely different affair...

It's exactly the same, except for where the reload() function is found:

http://docs.python.org/2/library/functions.html#reload

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the IPython-dev mailing list