[Python-Dev] Issue 10194 - Adding a gc.remap() function

Peter Ingebretson pingebre at yahoo.com
Wed Oct 27 01:31:41 CEST 2010


--- On Tue, 10/26/10, P.J. Eby <pje at telecommunity.com> wrote:
> If all you really want this for is reloading, it would
> probably make more sense to simply modify the existing class
> and function objects using the reloaded values as a
> template, then save the modified classes and functions back
> to the module.
> 
> Have you tried http://pypi.python.org/pypi/plone.reload
> or http://svn.python.org/projects/sandbox/trunk/xreload/xreload.py,
> or any other existing code reloaders, or tried extending
> them for your specific use case?
 
I've investigated several reloading frameworks, including the 
ones you mentions as well as http://code.google.com/p/reimport/ 
and http://code.google.com/p/livecoding/.

The approach of using the gc to remap references seemed to 
have the fewest overall limitations, but requiring C API changes 
is a big downside.  I'm going to have to do a more detailed 
comparison of the features offered by each approach.

--- On Tue, 10/26/10, exarkun at twistedmatrix.com <exarkun at twistedmatrix.com> wrote:
> This can be implemented with ctypes right now (I half did
> it several years ago).
> 
> Jean-Paul

Is there a trick to doing it this way, or are you suggesting 
building a ctypes wrapper for each C type in the Python 
library, and then effectively reimplementing tp_traverse 
in Python?



      


More information about the Python-Dev mailing list