@@ -1147,44 +1147,44 @@ are always available. They are listed here in alphabetical order.
11471147
11481148.. function :: locals()
11491149
1150- Return a mapping object representing the current local symbol table, with
1151- variable names as the keys, and their currently bound references as the
1152- values.
1153-
1154- At module scope, as well as when using :func: `exec ` or :func: `eval ` with
1155- a single namespace, this function returns the same namespace as
1156- :func: `globals `.
1157-
1158- At class scope, it returns the namespace that will be passed to the
1159- metaclass constructor.
1160-
1161- When using ``exec() `` or ``eval() `` with separate local and global
1162- arguments, it returns the local namespace passed in to the function call.
1163-
1164- In all of the above cases, each call to ``locals() `` in a given frame of
1165- execution will return the *same * mapping object. Changes made through
1166- the mapping object returned from ``locals() `` will be visible as assigned,
1167- reassigned, or deleted local variables, and assigning, reassigning, or
1168- deleting local variables will immediately affect the contents of the
1169- returned mapping object.
1170-
1171- In an :term: `optimized scope ` (including functions, generators, and
1172- coroutines), each call to ``locals() `` instead returns a fresh dictionary
1173- containing the current bindings of the function's local variables and any
1174- nonlocal cell references. In this case, name binding changes made via the
1175- returned dict are *not * written back to the corresponding local variables
1176- or nonlocal cell references, and assigning, reassigning, or deleting local
1177- variables and nonlocal cell references does *not * affect the contents
1178- of previously returned dictionaries.
1179-
1180- Calling ``locals() `` as part of a comprehension in a function, generator, or
1181- coroutine is equivalent to calling it in the containing scope, except that
1182- the comprehension's initialised iteration variables will be included. In
1183- other scopes, it behaves as if the comprehension were running as a nested
1184- function.
1185-
1186- Calling ``locals() `` as part of a generator expression is equivalent to
1187- calling it in a nested generator function.
1150+ Return a mapping object representing the current local symbol table, with
1151+ variable names as the keys, and their currently bound references as the
1152+ values.
1153+
1154+ At module scope, as well as when using :func: `exec ` or :func: `eval ` with
1155+ a single namespace, this function returns the same namespace as
1156+ :func: `globals `.
1157+
1158+ At class scope, it returns the namespace that will be passed to the
1159+ metaclass constructor.
1160+
1161+ When using ``exec() `` or ``eval() `` with separate local and global
1162+ arguments, it returns the local namespace passed in to the function call.
1163+
1164+ In all of the above cases, each call to ``locals() `` in a given frame of
1165+ execution will return the *same * mapping object. Changes made through
1166+ the mapping object returned from ``locals() `` will be visible as assigned,
1167+ reassigned, or deleted local variables, and assigning, reassigning, or
1168+ deleting local variables will immediately affect the contents of the
1169+ returned mapping object.
1170+
1171+ In an :term: `optimized scope ` (including functions, generators, and
1172+ coroutines), each call to ``locals() `` instead returns a fresh dictionary
1173+ containing the current bindings of the function's local variables and any
1174+ nonlocal cell references. In this case, name binding changes made via the
1175+ returned dict are *not * written back to the corresponding local variables
1176+ or nonlocal cell references, and assigning, reassigning, or deleting local
1177+ variables and nonlocal cell references does *not * affect the contents
1178+ of previously returned dictionaries.
1179+
1180+ Calling ``locals() `` as part of a comprehension in a function, generator, or
1181+ coroutine is equivalent to calling it in the containing scope, except that
1182+ the comprehension's initialised iteration variables will be included. In
1183+ other scopes, it behaves as if the comprehension were running as a nested
1184+ function.
1185+
1186+ Calling ``locals() `` as part of a generator expression is equivalent to
1187+ calling it in a nested generator function.
11881188
11891189 .. versionchanged :: 3.12
11901190 The behaviour of ``locals() `` in a comprehension has been updated as
0 commit comments