reloading modules and isinstance()

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Dec 5 13:40:08 EST 2007


En Wed, 05 Dec 2007 15:06:43 -0300, Tlis <tlis01 at googlemail.com> escribi�:

> With all the problems of the reload() function, I still hope, that
> there should be possible to write a safe module 'reloader', that would
> fix the references, as required (e.g. by changing the
> variable.__class__ references). This should be provided by every
> serious Python development environment.

Unfortunately that's not so simple, given the dynamic nature of Python.  
With some help from the programmer, reload may perform better; by example,  
if you never ever do "from module import xxx", and always do "import  
module" and use module.xxx everywhere. But it gets rather annoying, and  
still has many problems.

-- 
Gabriel Genellina




More information about the Python-list mailing list