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

Benjamin Peterson benjamin at python.org
Tue Oct 26 18:06:03 CEST 2010


2010/10/26 Peter Ingebretson <pingebre at yahoo.com>:
> I have a patch that adds a new function to the gc module.  The gc.remap()
> function uses the tp_traverse mechanism to find all references to any keys
> in a provided mapping, and remaps these references in-place to instead point
> to the value corresponding to each key.
>
> The motivation for adding this method is to enable writing a module that
> provide an enhanced version of imp.reload.  The builtin reload function
> is very useful for iterating on a single module within the Python interpreter
> shell, but in more complex situations it very limited.

Is there any reason that you'd want to do this?

...
> http://doublestar.org/python-hot-loading-prototype/
>
> Please let me know if you have any feedback on the reloading proposal, the
> hot loading prototype, or on the patch.

Overall, I think this adds lots of backwards incompatible code for an
obscure use-case that will cause subtle and complicated bugs. So, -1.




-- 
Regards,
Benjamin


More information about the Python-Dev mailing list