Life's better without builtins? (was: Life's better without braces)
Michael Hudson
mwh21 at cam.ac.uk
Fri Feb 25 14:16:26 EST 2000
Niels Diepeveen <niels at endea.demon.nl> writes:
> Michael Hudson schreef:
> >
> > Think module.__file__ & exec for reload. Something like
> >
> > def reload(module):
> > exec open(module.__file__[:-1]).read() in module.__dict__
> > return module
>
> That seems a perfect replacement. (except for the [:-1]?)
>>> import string
>>> print string.__file__
/usr/lib/python1.5/string.pyc
Helps? I don't know if it's *always* .pyc, so a true replacement
might want to check.
> So, only a few more hurdles before the release of PPython;-)
Believe me, I've thought of it. Even started a little, but I got bored.
Cheers,
M.
--
very few people approach me in real life and insist on proving they are
drooling idiots. -- Erik Naggum, comp.lang.lisp
More information about the Python-list
mailing list