summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-08-30 10:03:09 (GMT)
committerGeorg Brandl <georg@python.org>2008-08-30 10:03:09 (GMT)
commit6140651d9325fe25a132193e8ab19a8436adcf53 (patch)
tree76e5449c4dfe5c2d5407aacfa964f55c2e84d837
parentc176814d821e64722d1f40ac5cb882ab0c86fd72 (diff)
downloadcpython-6140651d9325fe25a132193e8ab19a8436adcf53.zip
cpython-6140651d9325fe25a132193e8ab19a8436adcf53.tar.gz
cpython-6140651d9325fe25a132193e8ab19a8436adcf53.tar.bz2
#3569: eval() also accepts "exec"able code objects.
-rw-r--r--Doc/library/functions.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 9586a34..d463924 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