Skip to content

Commit 713f1ab

Browse files
[3.13] gh-153808: Replace obsolete 'condition list' verbiage with 'expression list' in eval() docs (GH-153925)
(cherry picked from commit c5e97ed) Co-authored-by: palakkhinvasara <109575264+palakkhinvasara@users.noreply.github.com>
1 parent 9b2aca6 commit 713f1ab

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
@@ -594,9 +594,10 @@ are always available. They are listed here in alphabetical order.
594594
untrusted user-supplied input will lead to security vulnerabilities.
595595

596596
The *source* argument is parsed and evaluated as a Python expression
597-
(technically speaking, a condition list) using the *globals* and *locals*
598-
mappings as global and local namespace. If the *globals* dictionary is
599-
present and does not contain a value for the key ``__builtins__``, a
597+
(technically speaking, an :ref:`expression list <exprlists>`)
598+
using the *globals* and *locals* mappings as global and local namespace.
599+
If the *globals* dictionary is present and does not contain a value for the
600+
key ``__builtins__``, a
600601
reference to the dictionary of the built-in module :mod:`builtins` is
601602
inserted under that key before *source* is parsed.
602603
Overriding ``__builtins__`` can be used to restrict or change the available
@@ -616,6 +617,9 @@ are always available. They are listed here in alphabetical order.
616617
>>> eval('x+1')
617618
2
618619

620+
>>> eval("1, 2")
621+
(1, 2)
622+
619623
This function can also be used to execute arbitrary code objects (such as
620624
those created by :func:`compile`). In this case, pass a code object instead
621625
of a string. If the code object has been compiled with ``'exec'`` as the

0 commit comments

Comments
 (0)