Commit 6140651d authored by Georg Brandl's avatar Georg Brandl

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

parent c176814d
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment