File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -873,7 +873,12 @@ \section{The \keyword{exec} statement \label{exec}}
873873a code object. If it is a string, the string is parsed as a suite of
874874Python statements which is then executed (unless a syntax error
875875occurs). If it is an open file, the file is parsed until \EOF {} and
876- executed. If it is a code object, it is simply executed.
876+ executed. If it is a code object, it is simply executed. In all
877+ cases, the code that's executed is expected to be be valid as file
878+ input (see section~\ref {file-input }, `` File input'' ). Be aware that
879+ the \keyword {return} and \keyword {yield} statements may not be used
880+ outside of function definitions even within the context of code passed
881+ to the \keyword {exec} statement.
877882
878883In all cases, if the optional parts are omitted, the code is executed
879884in the current scope. If only the first expression after \keyword {in}
You can’t perform that action at this time.
0 commit comments