File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -465,12 +465,16 @@ are always available. They are listed here in alphabetical order.
465
465
dictionaries as global and local namespace. If the *globals * dictionary is
466
466
present and does not contain a value for the key ``__builtins__ ``, a
467
467
reference to the dictionary of the built-in module :mod: `builtins ` is
468
- inserted under that key before *expression * is parsed.
469
- This means that *expression * normally has full
470
- access to the standard :mod: `builtins ` module and restricted environments are
471
- propagated. If the *locals * dictionary is omitted it defaults to the *globals *
472
- dictionary. If both dictionaries are omitted, the expression is executed in the
473
- environment where :func: `eval ` is called. The return value is the result of
468
+ inserted under that key before *expression * is parsed. This means that
469
+ *expression * normally has full access to the standard :mod: `builtins `
470
+ module and restricted environments are propagated. If the *locals *
471
+ dictionary is omitted it defaults to the *globals * dictionary. If both
472
+ dictionaries are omitted, the expression is executed with the *globals * and
473
+ *locals * in the environment where :func: `eval ` is called. Note, *eval() *
474
+ does not have access to the :term: `nested scope `\s (non-locals) in the
475
+ enclosing environment.
476
+
477
+ The return value is the result of
474
478
the evaluated expression. Syntax errors are reported as exceptions. Example:
475
479
476
480
>>> x = 1
You can’t perform that action at this time.
0 commit comments