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

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