Skip to content

Commit

Permalink
Fix some incorrect indents in the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
koyuki7w committed Jan 26, 2025
1 parent 0ef8d47 commit 391ec3f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
76 changes: 38 additions & 38 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1154,44 +1154,44 @@ are always available. They are listed here in alphabetical order.

.. function:: locals()

Return a mapping object representing the current local symbol table, with
variable names as the keys, and their currently bound references as the
values.

At module scope, as well as when using :func:`exec` or :func:`eval` with
a single namespace, this function returns the same namespace as
:func:`globals`.

At class scope, it returns the namespace that will be passed to the
metaclass constructor.

When using ``exec()`` or ``eval()`` with separate local and global
arguments, it returns the local namespace passed in to the function call.

In all of the above cases, each call to ``locals()`` in a given frame of
execution will return the *same* mapping object. Changes made through
the mapping object returned from ``locals()`` will be visible as assigned,
reassigned, or deleted local variables, and assigning, reassigning, or
deleting local variables will immediately affect the contents of the
returned mapping object.

In an :term:`optimized scope` (including functions, generators, and
coroutines), each call to ``locals()`` instead returns a fresh dictionary
containing the current bindings of the function's local variables and any
nonlocal cell references. In this case, name binding changes made via the
returned dict are *not* written back to the corresponding local variables
or nonlocal cell references, and assigning, reassigning, or deleting local
variables and nonlocal cell references does *not* affect the contents
of previously returned dictionaries.

Calling ``locals()`` as part of a comprehension in a function, generator, or
coroutine is equivalent to calling it in the containing scope, except that
the comprehension's initialised iteration variables will be included. In
other scopes, it behaves as if the comprehension were running as a nested
function.

Calling ``locals()`` as part of a generator expression is equivalent to
calling it in a nested generator function.
Return a mapping object representing the current local symbol table, with
variable names as the keys, and their currently bound references as the
values.

At module scope, as well as when using :func:`exec` or :func:`eval` with
a single namespace, this function returns the same namespace as
:func:`globals`.

At class scope, it returns the namespace that will be passed to the
metaclass constructor.

When using ``exec()`` or ``eval()`` with separate local and global
arguments, it returns the local namespace passed in to the function call.

In all of the above cases, each call to ``locals()`` in a given frame of
execution will return the *same* mapping object. Changes made through
the mapping object returned from ``locals()`` will be visible as assigned,
reassigned, or deleted local variables, and assigning, reassigning, or
deleting local variables will immediately affect the contents of the
returned mapping object.

In an :term:`optimized scope` (including functions, generators, and
coroutines), each call to ``locals()`` instead returns a fresh dictionary
containing the current bindings of the function's local variables and any
nonlocal cell references. In this case, name binding changes made via the
returned dict are *not* written back to the corresponding local variables
or nonlocal cell references, and assigning, reassigning, or deleting local
variables and nonlocal cell references does *not* affect the contents
of previously returned dictionaries.

Calling ``locals()`` as part of a comprehension in a function, generator, or
coroutine is equivalent to calling it in the containing scope, except that
the comprehension's initialised iteration variables will be included. In
other scopes, it behaves as if the comprehension were running as a nested
function.

Calling ``locals()`` as part of a generator expression is equivalent to
calling it in a nested generator function.

.. versionchanged:: 3.12
The behaviour of ``locals()`` in a comprehension has been updated as
Expand Down
10 changes: 5 additions & 5 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ Exceptions
Constants
^^^^^^^^^

The AF_* and SOCK_* constants are now :class:`AddressFamily` and
:class:`SocketKind` :class:`.IntEnum` collections.
The AF_* and SOCK_* constants are now :class:`AddressFamily` and
:class:`SocketKind` :class:`.IntEnum` collections.

.. versionadded:: 3.4
.. versionadded:: 3.4

.. data:: AF_UNIX
AF_INET
Expand Down Expand Up @@ -670,9 +670,9 @@ Constants
Constant to optimize CPU locality, to be used in conjunction with
:data:`SO_REUSEPORT`.

.. versionadded:: 3.11
.. versionadded:: 3.11

.. availability:: Linux >= 3.9
.. availability:: Linux >= 3.9

.. data:: SO_REUSEPORT_LB

Expand Down

0 comments on commit 391ec3f

Please sign in to comment.