Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libfuncs.tex @ 20185:8d79db01b2ba legacy-trunk
The execfile() docs imply it acts on locals same as exec. But in truth
it acts more like assigning to keys in locals(), i.e. modifications to
function locals aren't reflected in the locals when execfile() returns.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 30 Sep 2001 06:32:59 +0000 |
| parents | 4c6922f266f0 |
| children | 7160d795473e |
line wrap: on
line diff
--- a/Doc/lib/libfuncs.tex Sun Sep 30 06:18:26 2001 +0000 +++ b/Doc/lib/libfuncs.tex Sun Sep 30 06:32:59 2001 +0000 @@ -257,6 +257,13 @@ If both dictionaries are omitted, the expression is executed in the environment where \function{execfile()} is called. The return value is \code{None}. + + \strong{Warning:} The default \var{locals} act as described for function + \function{locals()} below: modifications to the default \var{locals} + dictionary should not be attempted. Pass an explicit \var{locals} + dictionary if you need to see effects of the code on \var{locals} after + function \function{execfile()} returns. \function{execfile()} cannot + be used reliably to modify a function's locals. \end{funcdesc} \begin{funcdesc}{file}{filename\optional{, mode\optional{, bufsize}}}
