Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.14] gh-110631: Fix some incorrect indents in the documentation (GH-129312)#134419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 1 commit intopython:3.14frommiss-islington:backport-15a8b5b-3.14
May 21, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletionsDoc/library/functions.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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
48 changes: 24 additions & 24 deletionsDoc/library/importlib.resources.abc.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,44 +49,44 @@
.. method:: open_resource(resource)
:abstractmethod:

Returns an opened, :term:`file-like object` for binary reading
of the *resource*.
Returns an opened, :term:`file-like object` for binary reading
of the *resource*.

If the resource cannot be found, :exc:`FileNotFoundError` is
raised.
If the resource cannot be found, :exc:`FileNotFoundError` is
raised.

.. method:: resource_path(resource)
:abstractmethod:

Returns the file system path to the *resource*.
Returns the file system path to the *resource*.

If the resource does not concretely exist on the file system,
raise :exc:`FileNotFoundError`.
If the resource does not concretely exist on the file system,
raise :exc:`FileNotFoundError`.

.. method:: is_resource(name)
:abstractmethod:

Returns ``True`` if the named *name* is considered a resource.
:exc:`FileNotFoundError` is raised if *name* does not exist.
Returns ``True`` if the named *name* is considered a resource.
:exc:`FileNotFoundError` is raised if *name* does not exist.

.. method:: contents()
:abstractmethod:

Returns an :term:`iterable` of strings over the contents of
the package. Do note that it is not required that all names
returned by the iterator be actual resources, e.g. it is
acceptable to return names for which :meth:`is_resource` would
be false.

Allowing non-resource names to be returned is to allow for
situations where how a package and its resources are stored
are known a priori and the non-resource names would be useful.
For instance, returning subdirectory names is allowed so that
when it is known that the package and resources are stored on
the file system then those subdirectory names can be used
directly.

The abstract method returns an iterable of no items.
Returns an :term:`iterable` of strings over the contents of
the package. Do note that it is not required that all names
returned by the iterator be actual resources, e.g. it is
acceptable to return names for which :meth:`is_resource` would
be false.

Allowing non-resource names to be returned is to allow for
situations where how a package and its resources are stored
are known a priori and the non-resource names would be useful.
For instance, returning subdirectory names is allowed so that
when it is known that the package and resources are stored on
the file system then those subdirectory names can be used
directly.

The abstract method returns an iterable of no items.


.. class:: Traversable
Expand Down
4 changes: 2 additions & 2 deletionsDoc/library/signal.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -211,8 +211,8 @@ The variables defined in the :mod:`signal` module are:

.. data:: SIGSTKFLT

Stack fault on coprocessor. The Linux kernel does not raise this signal: it
can only be raised in user space.
Stack fault on coprocessor. The Linux kernel does not raise this signal: it
can only be raised in user space.

.. availability:: Linux.

Expand Down
10 changes: 5 additions & 5 deletionsDoc/library/socket.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -362,10 +362,10 @@
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

Check warning on line 365 in Doc/library/socket.rst

View workflow job for this annotation

GitHub Actions/ Docs / Docs

py:class reference target not found: AddressFamily [ref.class]

Check warning on line 365 in Doc/library/socket.rst

View workflow job for this annotation

GitHub Actions/ Docs / Docs

py:class reference target not found: SocketKind [ref.class]
:class:`SocketKind` :class:`.IntEnum` collections.

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

.. data:: AF_UNIX
AF_INET
Expand DownExpand Up@@ -773,9 +773,9 @@
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
Loading

[8]ページ先頭

©2009-2025 Movatter.jp