Dag Sverre Seljebotn wrote:
> Dag Sverre Seljebotn wrote:
>> Robert wrote:
>>> Robert wrote:
>>>> this and more related cleanup, speedup of importer, --inplace
>>>> --verbose reload() .. here now:
>>>>
>>>> http://trac.cython.org/cython_trac/ticket/312
>>>>
>>> maybe sb likes to test it further:
>>>
>>> * support for dynamic "reload(<pyxmodule>)" added: e.g change of
>>> the Cython code without stopping & relaunching a big app.
>>> <so_path>.reloadNN files may arise, as previously loaded files are
>>> blocked.
>>
>> This is great; I've always wanted reload to work...
>
> Reloading a C module is a very unsafe thing. It basically requires
> supporting PEP 3121 in Py3 and won't work in Py2 in most cases. You risk
> all sorts of memory leaks and unexpected behaviour.

Yes, I remember trying to do this myself and reading some tickets about
this not working in Py2...

Robert (not Bradshaw), can you perhaps submit the patch with the reload
stuff taken out for now?

Idea:

Have pyximport "load" the module by generating a Python file and load it:

from pyxbuilds.foo_1 import *

Then when reloading this py-file, hook that, do a new compile and
overwrite it with

from pyxbuilds.foo_2 import *

before Python reloads as usual. Could this work?

Dag Sverre

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to