How can I reexecute 'import foo from bar'?

Cliff Crawford cjc26 at nospam.cornell.edu
Fri Aug 18 14:50:15 EDT 2000


* Evan Weaver <eweaver at NoSpam.udel.edu> menulis:
| redhouse at my-deja.com wrote:
| 
| > I know I can do a reload on a module in IDLE, but when I do this, any
| > 'import foo from bar' foo's are not updated. I know I can get around
| > this by typing out the full qualifier, but is there some way to make
| > foo.method(instance) current other than typing out bar.foo.method
| > (instance)?
| 
| No.

Well, actually, you could do:

del foo
reload(bar)
foo = bar.foo


-- 
http://www.people.cornell.edu/pages/cjc26/     "This is what his platitudes
amount to, although, of course, they're daubed over with the viscid slobber
of  demented drivel  devised by his  henchmen and mindlessly  multiplied by
treasonous heartless pissants.  And that, in my view, is our real problem."



More information about the Python-list mailing list