Deprecating reload() ???

David MacQuigg dmq at gain.com
Mon Mar 15 21:09:20 EST 2004


On Mon, 15 Mar 2004 13:50:47 -0600, Skip Montanaro <skip at pobox.com>
wrote:

>    Dave> We should at least update the description of the reload function
>    Dave> in the Python Library Reference.  See the thread "Reload
>    Dave> Confusion" for some suggested text.
>
>Please file a bug report on Sourceforge so your ideas don't get lost.  Feel
>free to assign it to me (sf id == "montanaro").

Will do.  I would like to get a few comments from folks following this
thread before submitting the proposed text to Sourceforge.  Here is
the summary:
"""
To summarize what happens with reload(M1):

The module M1 must have been already imported in the current
namespace.

The new M1 is executed, and new objects are created in memory.

The names in the M1 namespace are updated to point to the new objects.
No other references are changed.  References to objects removed from
the new module remain unchanged.

Previously created references from other modules to the old objects
remain unchanged and must be updated in each namespace where they
occur.

The old objects remain in memory until all references to them are
gone.
"""

To read this in context, with a nice example, background discussion,
etc. see http://ece.arizona.edu/~edatools/Python/Reload.htm  I think
I've finally got it right, but I'm always prepared for another
surprise.

Once I'm confident that my understanding is correct, I'll see if I can
weave this into the existing text of the Library Reference.  I may try
also to put in some of the "motivation" for the way things are (from
the Background section of the above webpage.)

-- Dave




More information about the Python-list mailing list