Skip to content

Commit f51a748

Browse files
[3.13] gh-101100: Fix Sphinx documentation warnings in collections.rst (GH-130629) (#130779)
gh-101100: Fix Sphinx documentation warnings in `collections.rst` (GH-130629) (cherry picked from commit 373eb1b) Co-authored-by: Victorien <[email protected]>
1 parent e96f914 commit f51a748

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Doc/library/collections.rst

+11-10
Original file line numberDiff line numberDiff line change
@@ -748,8 +748,8 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
748748
returns or raises is then returned or raised by :meth:`~object.__getitem__`.
749749

750750
Note that :meth:`__missing__` is *not* called for any operations besides
751-
:meth:`~object.__getitem__`. This means that :meth:`get` will, like normal
752-
dictionaries, return ``None`` as a default rather than using
751+
:meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like
752+
normal dictionaries, return ``None`` as a default rather than using
753753
:attr:`default_factory`.
754754

755755

@@ -849,8 +849,9 @@ they add the ability to access fields by name instead of position index.
849849
Returns a new tuple subclass named *typename*. The new subclass is used to
850850
create tuple-like objects that have fields accessible by attribute lookup as
851851
well as being indexable and iterable. Instances of the subclass also have a
852-
helpful docstring (with typename and field_names) and a helpful :meth:`__repr__`
853-
method which lists the tuple contents in a ``name=value`` format.
852+
helpful docstring (with *typename* and *field_names*) and a helpful
853+
:meth:`~object.__repr__` method which lists the tuple contents in a ``name=value``
854+
format.
854855

855856
The *field_names* are a sequence of strings such as ``['x', 'y']``.
856857
Alternatively, *field_names* can be a single string with each fieldname
@@ -894,10 +895,10 @@ they add the ability to access fields by name instead of position index.
894895
Added the *module* parameter.
895896

896897
.. versionchanged:: 3.7
897-
Removed the *verbose* parameter and the :attr:`_source` attribute.
898+
Removed the *verbose* parameter and the :attr:`!_source` attribute.
898899

899900
.. versionchanged:: 3.7
900-
Added the *defaults* parameter and the :attr:`_field_defaults`
901+
Added the *defaults* parameter and the :attr:`~somenamedtuple._field_defaults`
901902
attribute.
902903

903904
.. doctest::
@@ -1109,7 +1110,7 @@ Some differences from :class:`dict` still remain:
11091110
A regular :class:`dict` can emulate the order sensitive equality test with
11101111
``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``.
11111112

1112-
* The :meth:`popitem` method of :class:`OrderedDict` has a different
1113+
* The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a different
11131114
signature. It accepts an optional argument to specify which item is popped.
11141115

11151116
A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)``
@@ -1119,7 +1120,7 @@ Some differences from :class:`dict` still remain:
11191120
with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the
11201121
leftmost (first) item if it exists.
11211122

1122-
* :class:`OrderedDict` has a :meth:`move_to_end` method to efficiently
1123+
* :class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to efficiently
11231124
reposition an element to an endpoint.
11241125

11251126
A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k,
@@ -1130,7 +1131,7 @@ Some differences from :class:`dict` still remain:
11301131
OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key
11311132
and its associated value to the leftmost (first) position.
11321133

1133-
* Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method.
1134+
* Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method.
11341135

11351136

11361137
.. class:: OrderedDict([items])
@@ -1185,7 +1186,7 @@ anywhere a regular dictionary is used.
11851186

11861187
.. versionchanged:: 3.6
11871188
With the acceptance of :pep:`468`, order is retained for keyword arguments
1188-
passed to the :class:`OrderedDict` constructor and its :meth:`update`
1189+
passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update`
11891190
method.
11901191

11911192
.. versionchanged:: 3.9

Doc/tools/.nitignore

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Doc/library/ast.rst
1616
Doc/library/asyncio-extending.rst
1717
Doc/library/asyncio-policy.rst
1818
Doc/library/asyncio-subprocess.rst
19-
Doc/library/collections.rst
2019
Doc/library/decimal.rst
2120
Doc/library/email.charset.rst
2221
Doc/library/email.compat32-message.rst

0 commit comments

Comments
 (0)