deleting, then re-importing a class method

Robert P. J. Day rpjday at crashcourse.ca
Thu Jan 21 11:04:40 CET 2010


  (once again, never ashamed to ask the dumb questions.)

  still playing with python3, and testing whether i can
delete/unimport a specific method, then re-import it:

>>> import sys
>>> print(sys.__doc__)
... blah blah blah ...
>>> del(sys.__doc__)
>>> print(sys.__doc__)
module(name[, doc])

Create a module object.
The name must be a string; the optional doc argument can have any
type.
>>>

  ok, now that i've deleted just that member of "sys", can i re-import
it?  i know this doesn't seem to work:

>>> import sys

  or is there an operator other than "import" that more represents a
full refresh of a class?

rday

p.s.  no, i don't have a valid application of the above, i'm just
trying to break things.

--


========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================



More information about the Python-list mailing list