Life's better without builtins? (was: Life's better without braces)

Gerrit Holl gerrit.holl at pobox.com
Sat Feb 26 09:17:13 EST 2000


<quote name="Moshe Zadka" date="951493339">
> On Fri, 25 Feb 2000, Niels Diepeveen wrote:
> 
> > Do you have some source code of this? I can't think of a way to do
> > reload() or tuple().
> 
> def reload(module):
> 	del sys.modules[module]
> 	exec 'import '+module

No. The 'reload()' function takes a module and returns a module:
>>> import os
>>> reload(os)
<module 'os' from '/usr/local/lib/python1.5/os.pyc'>

regards,
Gerrit.

-- 
Comparison Python GUI's: http://www.nl.linux.org/~gerrit/gui.html
Please comment!




More information about the Python-list mailing list