Skip to content

Commit c5e97ed

Browse files
gh-153808: Replace obsolete 'condition list' verbiage with 'expression list' in eval() docs (GH-153811)
1 parent bc2fd44 commit c5e97ed

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

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

637+
>>> eval("1, 2")
638+
(1, 2)
639+
636640
This function can also be used to execute arbitrary code objects (such as
637641
those created by :func:`compile`). In this case, pass a code object instead
638642
of a string. If the code object has been compiled with ``'exec'`` as the

0 commit comments

Comments
 (0)