Skip to content

Commit 01a4bee

Browse files
committed
Resolve reference warnings in reference/
1 parent 98b4cd6 commit 01a4bee

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,9 @@ The match statement is used for pattern matching. Syntax:
610610

611611
.. productionlist:: python-grammar
612612
match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT
613-
subject_expr: `star_named_expression` "," `star_named_expressions`?
614-
: | `named_expression`
615-
case_block: 'case' `patterns` [`guard`] ":" `block`
613+
subject_expr: `!star_named_expression` "," `!star_named_expressions`?
614+
: | `!named_expression`
615+
case_block: 'case' `patterns` [`guard`] ":" `!block`
616616

617617
.. note::
618618
This section uses single quotes to denote
@@ -701,7 +701,7 @@ Guards
701701
.. index:: ! guard
702702

703703
.. productionlist:: python-grammar
704-
guard: "if" `named_expression`
704+
guard: "if" `!named_expression`
705705

706706
A ``guard`` (which is part of the ``case``) must succeed for code inside
707707
the ``case`` block to execute. It takes the form: :keyword:`if` followed by an
@@ -1015,8 +1015,8 @@ subject value:
10151015
items, as for a fixed-length sequence.
10161016

10171017
.. note:: The length of the subject sequence is obtained via
1018-
:func:`len` (i.e. via the :meth:`__len__` protocol). This length may be
1019-
cached by the interpreter in a similar manner as
1018+
:func:`len` (i.e. via the :meth:`~object.__len__` protocol).
1019+
This length may be cached by the interpreter in a similar manner as
10201020
:ref:`value patterns <value-patterns>`.
10211021

10221022

Doc/reference/datamodel.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Sets
453453

454454
These represent a mutable set. They are created by the built-in :func:`set`
455455
constructor and can be modified afterwards by several methods, such as
456-
:meth:`~set.add`.
456+
:meth:`~add <frozenset.add>`.
457457

458458

459459
Frozen sets
@@ -1272,7 +1272,7 @@ Special attributes
12721272
* - .. attribute:: type.__firstlineno__
12731273
- The line number of the first line of the class definition,
12741274
including decorators.
1275-
Setting the :attr:`__module__` attribute removes the
1275+
Setting the :attr:`~type.__module__` attribute removes the
12761276
:attr:`!__firstlineno__` item from the type's dictionary.
12771277

12781278
.. versionadded:: 3.13
@@ -2351,6 +2351,9 @@ Customizing module attribute access
23512351
single: __dir__ (module attribute)
23522352
single: __class__ (module attribute)
23532353

2354+
.. method:: module.__getattr__
2355+
module.__dir__
2356+
23542357
Special names ``__getattr__`` and ``__dir__`` can be also used to customize
23552358
access to module attributes. The ``__getattr__`` function at the module level
23562359
should accept one argument which is the name of an attribute and return the
@@ -2364,6 +2367,8 @@ The ``__dir__`` function should accept no arguments, and return an iterable of
23642367
strings that represents the names accessible on module. If present, this
23652368
function overrides the standard :func:`dir` search on a module.
23662369

2370+
.. attribute:: module.__class__
2371+
23672372
For a more fine grained customization of the module behavior (setting
23682373
attributes, properties, etc.), one can set the ``__class__`` attribute of
23692374
a module object to a subclass of :class:`types.ModuleType`. For example::
@@ -2685,7 +2690,7 @@ class defining the method.
26852690
.. versionadded:: 3.6
26862691

26872692

2688-
When a class is created, :meth:`type.__new__` scans the class variables
2693+
When a class is created, :meth:`!type.__new__` scans the class variables
26892694
and makes callbacks to those with a :meth:`~object.__set_name__` hook.
26902695

26912696
.. method:: object.__set_name__(self, owner, name)

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ Doc/library/xml.sax.rst
5656
Doc/library/xmlrpc.client.rst
5757
Doc/library/xmlrpc.server.rst
5858
Doc/library/zlib.rst
59-
Doc/reference/compound_stmts.rst
60-
Doc/reference/datamodel.rst
6159
Doc/using/windows.rst
6260
Doc/whatsnew/2.4.rst
6361
Doc/whatsnew/2.5.rst

0 commit comments

Comments
 (0)