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

Commiteb492d3

Browse files
authored
[3.11]gh-110631: Fix reST indentation inDoc/reference (GH-110708) (#110741)
Fix wrong indentation in the Doc/reference dir..(cherry picked from commit41d8ec5)
1 parent90b2620 commiteb492d3

File tree

4 files changed

+78
-76
lines changed

4 files changed

+78
-76
lines changed

‎Doc/reference/compound_stmts.rst

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -644,14 +644,14 @@ Here's an overview of the logical flow of a match statement:
644644
specified below. **Name bindings made during a successful pattern match
645645
outlive the executed block and can be used after the match statement**.
646646

647-
..note::
647+
..note::
648648

649-
During failed pattern matches, some subpatterns may succeed. Do not
650-
rely on bindings being made for a failed match. Conversely, do not
651-
rely on variables remaining unchanged after a failed match. The exact
652-
behavior is dependent on implementation and may vary. This is an
653-
intentional decision made to allow different implementations to add
654-
optimizations.
649+
During failed pattern matches, some subpatterns may succeed. Do not
650+
rely on bindings being made for a failed match. Conversely, do not
651+
rely on variables remaining unchanged after a failed match. The exact
652+
behavior is dependent on implementation and may vary. This is an
653+
intentional decision made to allow different implementations to add
654+
optimizations.
655655

656656
#. If the pattern succeeds, the corresponding guard (if present) is evaluated. In
657657
this case all name bindings are guaranteed to have happened.
@@ -1172,8 +1172,10 @@ In simple terms ``CLS(P1, attr=P2)`` matches only if the following happens:
11721172
* ``isinstance(<subject>, CLS)``
11731173
* convert ``P1`` to a keyword pattern using ``CLS.__match_args__``
11741174
* For each keyword argument ``attr=P2``:
1175-
* ``hasattr(<subject>, "attr")``
1176-
* ``P2`` matches ``<subject>.attr``
1175+
1176+
* ``hasattr(<subject>, "attr")``
1177+
* ``P2`` matches ``<subject>.attr``
1178+
11771179
* ... and so on for the corresponding keyword argument/pattern pair.
11781180

11791181
..seealso::
@@ -1600,29 +1602,29 @@ body of a coroutine function.
16001602
16011603
.. [#]In pattern matching, a sequence is defined as one of the following:
16021604
1603-
* a class that inherits from:class:`collections.abc.Sequence`
1604-
* a Python class that has been registered as:class:`collections.abc.Sequence`
1605-
* a builtin class that has its (CPython):c:macro:`Py_TPFLAGS_SEQUENCE` bit set
1606-
* a class that inherits from any of the above
1605+
* a class that inherits from:class:`collections.abc.Sequence`
1606+
* a Python class that has been registered as:class:`collections.abc.Sequence`
1607+
* a builtin class that has its (CPython):c:macro:`Py_TPFLAGS_SEQUENCE` bit set
1608+
* a class that inherits from any of the above
16071609
16081610
The following standard library classes are sequences:
16091611
1610-
*:class:`array.array`
1611-
*:class:`collections.deque`
1612-
*:class:`list`
1613-
*:class:`memoryview`
1614-
*:class:`range`
1615-
*:class:`tuple`
1612+
*:class:`array.array`
1613+
*:class:`collections.deque`
1614+
*:class:`list`
1615+
*:class:`memoryview`
1616+
*:class:`range`
1617+
*:class:`tuple`
16161618
16171619
..note::Subject values of type ``str``, ``bytes``, and ``bytearray``
16181620
do not match sequence patterns.
16191621
16201622
.. [#]In pattern matching, a mapping is defined as one of the following:
16211623
1622-
* a class that inherits from:class:`collections.abc.Mapping`
1623-
* a Python class that has been registered as:class:`collections.abc.Mapping`
1624-
* a builtin class that has its (CPython):c:macro:`Py_TPFLAGS_MAPPING` bit set
1625-
* a class that inherits from any of the above
1624+
* a class that inherits from:class:`collections.abc.Mapping`
1625+
* a Python class that has been registered as:class:`collections.abc.Mapping`
1626+
* a builtin class that has its (CPython):c:macro:`Py_TPFLAGS_MAPPING` bit set
1627+
* a class that inherits from any of the above
16261628
16271629
The standard library classes:class:`dict` and:class:`types.MappingProxyType`
16281630
are mappings.

‎Doc/reference/expressions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ the yield expression. It can be either set explicitly when raising
499499
:exc:`StopIteration`, or automatically when the subiterator is a generator
500500
(by returning a value from the subgenerator).
501501

502-
..versionchanged::3.3
503-
Added ``yield from <expr>`` to delegate control flow to a subiterator.
502+
..versionchanged::3.3
503+
Added ``yield from <expr>`` to delegate control flow to a subiterator.
504504

505505
The parentheses may be omitted when the yield expression is the sole expression
506506
on the right hand side of an assignment statement.

‎Doc/reference/import.rst

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -373,32 +373,32 @@ of what happens during the loading portion of import::
373373

374374
Note the following details:
375375

376-
* If there is an existing module object with the given name in
377-
:data:`sys.modules`, import will have already returned it.
376+
* If there is an existing module object with the given name in
377+
:data:`sys.modules`, import will have already returned it.
378378

379-
* The module will exist in:data:`sys.modules` before the loader
380-
executes the module code. This is crucial because the module code may
381-
(directly or indirectly) import itself; adding it to:data:`sys.modules`
382-
beforehand prevents unbounded recursion in the worst case and multiple
383-
loading in the best.
379+
* The module will exist in:data:`sys.modules` before the loader
380+
executes the module code. This is crucial because the module code may
381+
(directly or indirectly) import itself; adding it to:data:`sys.modules`
382+
beforehand prevents unbounded recursion in the worst case and multiple
383+
loading in the best.
384384

385-
* If loading fails, the failing module -- and only the failing module --
386-
gets removed from:data:`sys.modules`. Any module already in the
387-
:data:`sys.modules` cache, and any module that was successfully loaded
388-
as a side-effect, must remain in the cache. This contrasts with
389-
reloading where even the failing module is left in:data:`sys.modules`.
385+
* If loading fails, the failing module -- and only the failing module --
386+
gets removed from:data:`sys.modules`. Any module already in the
387+
:data:`sys.modules` cache, and any module that was successfully loaded
388+
as a side-effect, must remain in the cache. This contrasts with
389+
reloading where even the failing module is left in:data:`sys.modules`.
390390

391-
* After the module is created but before execution, the import machinery
392-
sets the import-related module attributes ("_init_module_attrs" in
393-
the pseudo-code example above), as summarized in a
394-
:ref:`later section<import-mod-attrs>`.
391+
* After the module is created but before execution, the import machinery
392+
sets the import-related module attributes ("_init_module_attrs" in
393+
the pseudo-code example above), as summarized in a
394+
:ref:`later section<import-mod-attrs>`.
395395

396-
* Module execution is the key moment of loading in which the module's
397-
namespace gets populated. Execution is entirely delegated to the
398-
loader, which gets to decide what gets populated and how.
396+
* Module execution is the key moment of loading in which the module's
397+
namespace gets populated. Execution is entirely delegated to the
398+
loader, which gets to decide what gets populated and how.
399399

400-
* The module created during loading and passed to exec_module() may
401-
not be the one returned at the end of import [#fnlo]_.
400+
* The module created during loading and passed to exec_module() may
401+
not be the one returned at the end of import [#fnlo]_.
402402

403403
..versionchanged::3.4
404404
The import system has taken over the boilerplate responsibilities of
@@ -415,13 +415,13 @@ returned from :meth:`~importlib.abc.Loader.exec_module` is ignored.
415415

416416
Loaders must satisfy the following requirements:
417417

418-
* If the module is a Python module (as opposed to a built-in module or a
419-
dynamically loaded extension), the loader should execute the module's code
420-
in the module's global name space (``module.__dict__``).
418+
* If the module is a Python module (as opposed to a built-in module or a
419+
dynamically loaded extension), the loader should execute the module's code
420+
in the module's global name space (``module.__dict__``).
421421

422-
* If the loader cannot execute the module, it should raise an
423-
:exc:`ImportError`, although any other exception raised during
424-
:meth:`~importlib.abc.Loader.exec_module` will be propagated.
422+
* If the loader cannot execute the module, it should raise an
423+
:exc:`ImportError`, although any other exception raised during
424+
:meth:`~importlib.abc.Loader.exec_module` will be propagated.
425425

426426
In many cases, the finder and loader can be the same object; in such cases the
427427
:meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return a
@@ -451,20 +451,20 @@ import machinery will create the new module itself.
451451
functionality described above in addition to executing the module. All
452452
the same constraints apply, with some additional clarification:
453453

454-
* If there is an existing module object with the given name in
455-
:data:`sys.modules`, the loader must use that existing module.
456-
(Otherwise,:func:`importlib.reload` will not work correctly.) If the
457-
named module does not exist in:data:`sys.modules`, the loader
458-
must create a new module object and add it to:data:`sys.modules`.
454+
* If there is an existing module object with the given name in
455+
:data:`sys.modules`, the loader must use that existing module.
456+
(Otherwise,:func:`importlib.reload` will not work correctly.) If the
457+
named module does not exist in:data:`sys.modules`, the loader
458+
must create a new module object and add it to:data:`sys.modules`.
459459

460-
* The module *must* exist in:data:`sys.modules` before the loader
461-
executes the module code, to prevent unbounded recursion or multiple
462-
loading.
460+
* The module *must* exist in:data:`sys.modules` before the loader
461+
executes the module code, to prevent unbounded recursion or multiple
462+
loading.
463463

464-
* If loading fails, the loader must remove any modules it has inserted
465-
into:data:`sys.modules`, but it must remove **only** the failing
466-
module(s), and only if the loader itself has loaded the module(s)
467-
explicitly.
464+
* If loading fails, the loader must remove any modules it has inserted
465+
into:data:`sys.modules`, but it must remove **only** the failing
466+
module(s), and only if the loader itself has loaded the module(s)
467+
explicitly.
468468

469469
..versionchanged::3.5
470470
A:exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but
@@ -664,17 +664,17 @@ with defaults for whatever information is missing.
664664

665665
Here are the exact rules used:
666666

667-
* If the module has a ``__spec__`` attribute, the information in the spec
668-
is used to generate the repr. The "name", "loader", "origin", and
669-
"has_location" attributes are consulted.
667+
* If the module has a ``__spec__`` attribute, the information in the spec
668+
is used to generate the repr. The "name", "loader", "origin", and
669+
"has_location" attributes are consulted.
670670

671-
* If the module has a ``__file__`` attribute, this is used as part of the
672-
module's repr.
671+
* If the module has a ``__file__`` attribute, this is used as part of the
672+
module's repr.
673673

674-
* If the module has no ``__file__`` but does have a ``__loader__`` that is not
675-
``None``, then the loader's repr is used as part of the module's repr.
674+
* If the module has no ``__file__`` but does have a ``__loader__`` that is not
675+
``None``, then the loader's repr is used as part of the module's repr.
676676

677-
* Otherwise, just use the module's ``__name__`` in the repr.
677+
* Otherwise, just use the module's ``__name__`` in the repr.
678678

679679
..versionchanged::3.4
680680
Use of:meth:`loader.module_repr() <importlib.abc.Loader.module_repr>`

‎Doc/reference/lexical_analysis.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,10 @@ is more easily recognized as broken.) It is also important to note that the
641641
escape sequences only recognized in string literals fall into the category of
642642
unrecognized escapes for bytes literals.
643643

644-
..versionchanged::3.6
645-
Unrecognized escape sequences produce a:exc:`DeprecationWarning`. In
646-
a future Python version they will be a:exc:`SyntaxWarning` and
647-
eventually a:exc:`SyntaxError`.
644+
..versionchanged::3.6
645+
Unrecognized escape sequences produce a:exc:`DeprecationWarning`. In
646+
a future Python version they will be a:exc:`SyntaxWarning` and
647+
eventually a:exc:`SyntaxError`.
648648

649649
Even in a raw literal, quotes can be escaped with a backslash, but the
650650
backslash remains in the result; for example, ``r"\""`` is a valid string

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp