[Tutor] newbie Python Modules
Kent Johnson
kent37 at tds.net
Tue Jun 17 02:08:56 CEST 2008
On Mon, Jun 16, 2008 at 4:38 PM, Guess?!? <wtfwhoami at gmail.com> wrote:
> Also once we reload the module .... every value reverts to its original
> value .. Am I Right?
Yes, but maybe not in the way you think. A new copy of the module will
be loaded and bound to the name 'eli'. But the names x, y and
printValues, which are bound to values in the old copy of the module,
will not change.
So if, after all your above manipulations, you
import eli
reload(eli)
you will see that x, y and printValues have the same values as before,
but eli.x and eli.y will be restored to the original values.
Kent
More information about the Tutor
mailing list