Skip to content

Commit 1cde4ed

Browse files
[3.14] gh-153808: Replace obsolete 'condition list' verbiage with 'expression list' in eval() docs (GH-153924)
(cherry picked from commit c5e97ed) Co-authored-by: palakkhinvasara <109575264+palakkhinvasara@users.noreply.github.com>
1 parent 8fe1538 commit 1cde4ed

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Doc/library/functions.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,10 @@ are always available. They are listed here in alphabetical order.
600600
untrusted user-supplied input will lead to security vulnerabilities.
601601

602602
The *source* argument is parsed and evaluated as a Python expression
603-
(technically speaking, a condition list) using the *globals* and *locals*
604-
mappings as global and local namespace. If the *globals* dictionary is
605-
present and does not contain a value for the key ``__builtins__``, a
603+
(technically speaking, an :ref:`expression list <exprlists>`)
604+
using the *globals* and *locals* mappings as global and local namespace.
605+
If the *globals* dictionary is present and does not contain a value for the
606+
key ``__builtins__``, a
606607
reference to the dictionary of the built-in module :mod:`builtins` is
607608
inserted under that key before *source* is parsed.
608609
Overriding ``__builtins__`` can be used to restrict or change the available
@@ -622,6 +623,9 @@ are always available. They are listed here in alphabetical order.
622623
>>> eval('x+1')
623624
2
624625

626+
>>> eval("1, 2")
627+
(1, 2)
628+
625629
This function can also be used to execute arbitrary code objects (such as
626630
those created by :func:`compile`). In this case, pass a code object instead
627631
of a string. If the code object has been compiled with ``'exec'`` as the

0 commit comments

Comments
 (0)