From: Georg Brandl Date: Sat, 30 Aug 2008 10:03:09 +0000 (+0000) Subject: #3569: eval() also accepts "exec"able code objects. X-Git-Tag: v2.6rc1~117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6140651d9325fe25a132193e8ab19a8436adcf53;p=thirdparty%2FPython%2Fcpython.git #3569: eval() also accepts "exec"able code objects. --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 9586a3492aaf..d463924f37b8 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -381,10 +381,10 @@ available. They are listed here in alphabetical order. >>> 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