summaryrefslogtreecommitdiffstats
path: root/Doc/library/functions.rst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-11-11 21:43:42 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-11-11 21:43:42 (GMT)
commitd3013ffa49e889ff96ed967f574aa01b91b09f12 (patch)
tree31769d7cce315e8628098efa7367c99344b2a975 /Doc/library/functions.rst
parent3e4e72f66f4e9d379d7734b5d0de92fc0b4d9596 (diff)
downloadcpython-d3013ffa49e889ff96ed967f574aa01b91b09f12.zip
cpython-d3013ffa49e889ff96ed967f574aa01b91b09f12.tar.gz
cpython-d3013ffa49e889ff96ed967f574aa01b91b09f12.tar.bz2
exec won't take file objects anymore
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r--Doc/library/functions.rst17
1 files changed, 8 insertions, 9 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index e885c3b..b49df65 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -391,16 +391,15 @@ are always available. They are listed here in alphabetical order.
.. function:: exec(object[, globals[, locals]])
- This function supports dynamic execution of Python code. *object* must be either
- a string, an open file object, or a code object. If it is a string, the string
- is parsed as a suite of Python statements which is then executed (unless a
- syntax error occurs). If it is an open file, the file is parsed until EOF and
- executed. If it is a code object, it is simply executed. In all cases, the
+ This function supports dynamic execution of Python code. *object* must be
+ either a string or a code object. If it is a string, the string is parsed as
+ a suite of Python statements which is then executed (unless a syntax error
+ occurs). If it is a code object, it is simply executed. In all cases, the
code that's executed is expected to be valid as file input (see the section
- "File input" in the Reference Manual). Be aware that the :keyword:`return` and
- :keyword:`yield` statements may not be used outside of function definitions even
- within the context of code passed to the :func:`exec` function. The return value
- is ``None``.
+ "File input" in the Reference Manual). Be aware that the :keyword:`return`
+ and :keyword:`yield` statements may not be used outside of function
+ definitions even within the context of code passed to the :func:`exec`
+ function. The return value is ``None``.
In all cases, if the optional parts are omitted, the code is executed in the
current scope. If only *globals* is provided, it must be a dictionary, which