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

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