Subject: RE: Execfile() - bug / strange behavior - DN [1]
"Tim Peters" <tim_one@email.msn.com> - 05 Feb 2000 - comp.lang.python
[Amit's execfile woes]
[Tim]
> You can't actually get the timbot interested in pursuing this, since
> it never uses these things without explicity naming the dicts it
> wants used as execution context.
[Carel Fellinger]
> And how then would it pass on the locals dict in this case?
It wouldn't: as a bot, it's incapable of wholly irrational behavior <wink>.
Executing blobs of unknown code for their side-effects on local vrbls is at
the very best extremely questionable practice. "Dark and useless" is fun,
but should be done in pvt -- like all other masturbatory practices.
> According to the docs, and a recent explanation on this list, it is
> not possible to use something like
> execfile("1.txt", globals(), locals()),
> as those are readonly in case of functions! One of the few dark
> corners of Python IMHO.
More a dark corner of the human soul, that someone would want to try that --
Python lovingly intervenes, saying "beyond this line, thou shall not
cross!". Until you download bytecodehacks, anyway <wink>.
as-a-language-of-the-world-python-can't-keep-out-the-devil-
but-as-a-language-of-god-it-handcuffs-the-beast-ly y'rs - tim
Last modified
2000-02-10
2000-02-10
(195.108.246.50)
Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated
