bpo-22057: Clarify eval() documentation (GH-8812) · python/cpython@0e1e8db (original) (raw)

Original file line number Diff line number Diff line change
@@ -434,8 +434,10 @@ are always available. They are listed here in alphabetical order.
434 434 The *expression* argument is parsed and evaluated as a Python expression
435 435 (technically speaking, a condition list) using the *globals* and *locals*
436 436 dictionaries as global and local namespace. If the *globals* dictionary is
437 - present and lacks '__builtins__', the current globals are copied into *globals*
438 - before *expression* is parsed. This means that *expression* normally has full
437 + present and does not contain a value for the key ``__builtins__``, a
438 + reference to the dictionary of the built-in module :mod:`builtins` is
439 + inserted under that key before *expression* is parsed.
440 + This means that *expression* normally has full
439 441 access to the standard :mod:`builtins` module and restricted environments are
440 442 propagated. If the *locals* dictionary is omitted it defaults to the *globals*
441 443 dictionary. If both dictionaries are omitted, the expression is executed in the