[Python-checkins] r66065 - python/trunk/Doc/library/functions.rst

georg.brandl python-checkins at python.org
Sat Aug 30 12:03:10 CEST 2008


Author: georg.brandl
Date: Sat Aug 30 12:03:09 2008
New Revision: 66065

Log:
#3569: eval() also accepts "exec"able code objects.


Modified:
   python/trunk/Doc/library/functions.rst

Modified: python/trunk/Doc/library/functions.rst
==============================================================================
--- 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')
       2
 
-   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 mailing list