[IronPython] Clearing context

Curt Hagenlocher curt at hagenlocher.org
Thu Jan 10 00:19:33 CET 2008


On Jan 9, 2008 2:45 PM, Tim Roberts <timr at probo.com> wrote:
>
>  This is an important point, and I still don't think you have it exactly
> right.  When you say "including changes made by a reload", that really
> should say "ONLY IF the module has been reloaded".  Unless you reload it,
> the "mymod" that is in the module cache will never change, and therefore
> SomeFunc will always get the same version of myfunc().

There are many ways to update module contents; reloading is only one
of them.  If I said (from hypothetical module foo):

import mymod
mymod.myfunc = lambda obj: obj + 1

I will successfully have modified the value of myfunc without doing a
reload.  And saying "from mymod import myfunc" will pickup the new
function that's been assigned to that symbol.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list