File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -343,13 +343,14 @@ \section{Built-in Functions \label{built-in-funcs}}
343343 and does not create a new module.\footnote {It is used relatively
344344 rarely so does not warrant being made into a statement.}
345345
346- The arguments are a file name and two optional dictionaries. The
347- file is parsed and evaluated as a sequence of Python statements
348- (similarly to a module) using the \var {globals} and \var {locals}
349- dictionaries as global and local namespace. If the \var {locals}
350- dictionary is omitted it defaults to the \var {globals} dictionary.
351- If both dictionaries are omitted, the expression is executed in the
352- environment where \function {execfile()} is called. The return value is
346+ The arguments are a file name and two optional dictionaries. The file is
347+ parsed and evaluated as a sequence of Python statements (similarly to a
348+ module) using the \var {globals} and \var {locals} dictionaries as global and
349+ local namespace. If provided, \var {locals} can be any mapping object.
350+ \versionchanged [formerly \var {locals} was required to be a dictionary]{2.4}
351+ If the \var {locals} dictionary is omitted it defaults to the \var {globals}
352+ dictionary. If both dictionaries are omitted, the expression is executed in
353+ the environment where \function {execfile()} is called. The return value is
353354 \code {None}.
354355
355356 \warning {The default \var {locals} act as described for function
Original file line number Diff line number Diff line change @@ -873,8 +873,9 @@ \section{The \keyword{exec} statement \label{exec}}
873873in the current scope. If only the first expression after \keyword {in}
874874is specified, it should be a dictionary, which will be used for both
875875the global and the local variables. If two expressions are given,
876- both must be dictionaries and they are used for the global and local
877- variables, respectively.
876+ they are used for the global and local variables, respectively.
877+ If provided, \var {locals} can be any mapping object.
878+ \versionchanged [formerly \var {locals} was required to be a dictionary]{2.4}
878879
879880As a side effect, an implementation may insert additional keys into
880881the dictionaries given besides those corresponding to variable names
You can’t perform that action at this time.
0 commit comments