Frederic Rentsch <anthra.nor...@bluewin.ch> wrote: > >I develop in an IDLE window. > >Module M says 'from service import *'. >Next I correct a mistake in function 'service.f'. >Now 'service.f' works fine. > >I do 'reload (service); reload (M)'. >The function 'M.f' still misbehaves. > >'print inspect.getsource (service.f)' and >'print inspect.getsource (M.f)' shows the same >corrected code. > >'print service.f' and 'print M.f' show different ids.
Yes. This: from service import xxx is essentially the same as: import service xxx = service.xxx At that point, xxx contains a reference to the "service.xxx" object as it is right now. When you do a reload, that imports a new version of "service.xxx", but your global "xxx" object is still bound to the old one. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list