Deprecating reload() ???

David MacQuigg dmq at gain.com
Sat Mar 13 10:12:07 EST 2004


On Fri, 12 Mar 2004 21:56:24 -0600, Skip Montanaro <skip at pobox.com>
wrote:

>    Dave> I've written a short description of what reload() does to try and
>    Dave> help reduce the confusion.  This is intended for EEs who are new
>    Dave> to Python.
>
>I'm not sure why you're planning to teach them reload().  I've used it
>rarely in about ten years of Python programming.  Its basic semantics are
>straightforward, but as we've seen from the discussions in this thread
>things can go subtly awry.  Just tell people to either not create references
>which refer to globals in other modules (e.g. "quote = urllib.quote") if
>they intend to use reload() or tell them to just exit and restart their
>application, at least until they understand the limitations of trying to
>modify a running Python program.

I don't think we can avoid reload().  A typicial design session has
several tools running, and it is a real pain to restart.  Design
engineers often leave sessions open for several days.

What I will try to do is write the modules that are likely to be
reloaded in a way that minimizes the problems, accessing objects in
those modules *only* via their fully-qualified names, etc.

Again, these are interactive sessions.  I don't think I will need
reload() as part of the code.

-- Dave




More information about the Python-list mailing list