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

Niels Diepeveen niels at endea.demon.nl
Fri Feb 25 12:32:09 EST 2000


Moshe Zadka schreef:
> 
> 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

This doesn't seem to work. I think that would be because the import is
local to the function?

> 
> def tuple(seq):
>         ret = ()
>         for item in seq:
>                 ret = ret + (item,)
>         return ret
> 
> Ouch big time!

Anyone seen half a brain lying around? Thanks.

-- 
Niels Diepeveen
Endea automatisering





More information about the Python-list mailing list