[Python-checkins] r66065 - python/trunk/Doc/library/functions.rst
python-checkins at python.org
Sat Aug 30 12:03:10 CEST 2008
Date: Sat Aug 30 12:03:09 2008
New Revision: 66065
#3569: eval() also accepts "exec"able code objects.
--- python/trunk/Doc/library/functions.rst (original)
+++ python/trunk/Doc/library/functions.rst Sat Aug 30 12:03:09 2008
@@ -381,10 +381,10 @@
>>> print eval('x+1')
- This function can also be used to execute arbitrary code objects (such as those
- created by :func:`compile`). In this case pass a code object instead of a
- string. The code object must have been compiled passing ``'eval'`` as the
- *kind* argument.
+ This function can also be used to execute arbitrary code objects (such as
+ those created by :func:`compile`). In this case pass a code object instead
+ of a string. If the code object has been compiled with ``'exec'`` as the
+ *kind* argument, :func:`eval`\'s return value will be ``None``.
Hints: dynamic execution of statements is supported by the :keyword:`exec`
statement. Execution of statements from a file is supported by the
More information about the Python-checkins