Deprecating reload() ???

Skip Montanaro skip at pobox.com
Fri Mar 12 22:56:24 EST 2004


Just an FYI, I didn't write this statement:

    Dave> On Fri, 12 Mar 2004 11:42:06 -0600, Skip Montanaro <skip at pobox.com>
    Dave> wrote:

    >> >> Reload is not broken, and certainly shouldn't be deprecated at least
    >> >> until there's a better solution that won't suffer from reload's one
    >> >> problem, IMHO, which is that it surprises some people by its
    >> >> behaviour.

    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.

Skip




More information about the Python-list mailing list