@@ -1063,14 +1063,15 @@ are always available. They are listed here in alphabetical order.
1063
1063
variable names as the keys, and their currently bound references as the
1064
1064
values.
1065
1065
1066
- At module scope, as well as when using ``exec() `` or ``eval() `` with a
1067
- single namespace, this function returns the same namespace as ``globals() ``.
1066
+ At module scope, as well as when using :func: `exec ` or :func: `eval ` with
1067
+ a single namespace, this function returns the same namespace as
1068
+ :func: `globals `.
1068
1069
1069
1070
At class scope, it returns the namespace that will be passed to the
1070
1071
metaclass constructor.
1071
1072
1072
1073
When using ``exec() `` or ``eval() `` with separate local and global
1073
- namespaces , it returns the local namespace passed in to the function call.
1074
+ arguments , it returns the local namespace passed in to the function call.
1074
1075
1075
1076
In all of the above cases, each call to ``locals() `` in a given frame of
1076
1077
execution will return the *same * mapping object. Changes made through
@@ -1116,20 +1117,20 @@ are always available. They are listed here in alphabetical order.
1116
1117
returned dictionary with the results of subsequent calls to ``locals() ``.
1117
1118
1118
1119
.. versionchanged :: 3.13
1119
- As part of :pep: `667 `, calling `locals() ` in a comprehension at module
1120
- or class scope (including via `exec ` or `eval `) once more behaves as if
1120
+ As part of :pep: `667 `, calling `` locals() ` ` in a comprehension at module
1121
+ or class scope (including via `` exec `` or `` eval ` `) once more behaves as if
1121
1122
the comprehension were running as an independent nested function (i.e.
1122
1123
the local variables from the containing scope are not included).
1123
1124
1124
1125
.. versionchanged :: 3.12
1125
- As part of :pep: `709 `, calling `locals() ` in a comprehension at module
1126
- or class scope (including via `exec ` or `eval `) produces an independent
1126
+ As part of :pep: `709 `, calling `` locals() ` ` in a comprehension at module
1127
+ or class scope (including via `` exec `` or `` eval ` `) produces an independent
1127
1128
snapshot of the containing scope with the comprehension iteration
1128
1129
variable(s) included.
1129
1130
1130
1131
.. versionchanged :: 3.12
1131
- As part of :pep: `709 `, calling `locals() ` in a comprehension as part of a
1132
- function, generator, or coroutine returns the same `locals() ` reference
1132
+ As part of :pep: `709 `, calling `` locals() ` ` in a comprehension as part of a
1133
+ function, generator, or coroutine returns the same `` locals() ` ` reference
1133
1134
as calls in the containing scope.
1134
1135
1135
1136
..
0 commit comments