[Python-ideas] Enhance reload

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Oct 1 02:44:25 CEST 2007

Joseph Maurer wrote:
> Another post I read proposed a Reclass feature that only worked 
 > for classes.

You could probably do something similar for functions.
Go through the new module, and when you find a function,
look to see whether there is something defined in the
old module that's also a function. If so, replace the
old function's code object with that of the new one.

If you extend this to functions inside classes as well,
you may even be able to catch bound methods that have
been squirrelled away as well.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+

More information about the Python-ideas mailing list