Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 0 additions & 1 deletion Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@
('py:attr', '__annotations__'),
('py:meth', '__missing__'),
('py:attr', '__wrapped__'),
('py:meth', 'index'), # list.index, tuple.index, etc.
]

# gh-106948: Copy standard C types declared in the "c:type" domain and C
Expand Down
4 changes: 2 additions & 2 deletions Doc/faq/design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ exhaustive test suites that exercise every line of code in a module.
An appropriate testing discipline can help build large complex applications in
Python as well as having interface specifications would. In fact, it can be
better because an interface specification cannot test certain properties of a
program. For example, the :meth:`!list.append` method is expected to add new elements
program. For example, the :meth:`list.append` method is expected to add new elements
to the end of some internal list; an interface specification cannot test that
your :meth:`!list.append` implementation will actually do this correctly, but it's
your :meth:`list.append` implementation will actually do this correctly, but it's
trivial to check this property in a test suite.

Writing test suites is very helpful, and you might want to design your code to
Expand Down
8 changes: 4 additions & 4 deletions Doc/faq/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ There are two factors that produce this result:
(the list), and both ``x`` and ``y`` refer to it.
2) Lists are :term:`mutable`, which means that you can change their content.

After the call to :meth:`!append`, the content of the mutable object has
After the call to :meth:`~sequence.append`, the content of the mutable object has
changed from ``[]`` to ``[10]``. Since both the variables refer to the same
object, using either name accesses the modified value ``[10]``.

Expand Down Expand Up @@ -1397,9 +1397,9 @@ To see why this happens, you need to know that (a) if an object implements an
:meth:`~object.__iadd__` magic method, it gets called when the ``+=`` augmented
assignment
is executed, and its return value is what gets used in the assignment statement;
and (b) for lists, :meth:`!__iadd__` is equivalent to calling :meth:`!extend` on the list
and returning the list. That's why we say that for lists, ``+=`` is a
"shorthand" for :meth:`!list.extend`::
and (b) for lists, :meth:`!__iadd__` is equivalent to calling
:meth:`~sequence.extend` on the list and returning the list.
That's why we say that for lists, ``+=`` is a "shorthand" for :meth:`list.extend`::

>>> a_list = []
>>> a_list += [1]
Expand Down
5 changes: 3 additions & 2 deletions Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1251,8 +1251,9 @@ Glossary
The :class:`collections.abc.Sequence` abstract base class
defines a much richer interface that goes beyond just
:meth:`~object.__getitem__` and :meth:`~object.__len__`, adding
:meth:`!count`, :meth:`!index`, :meth:`~object.__contains__`, and
:meth:`~object.__reversed__`. Types that implement this expanded
:meth:`~sequence.count`, :meth:`~sequence.index`,
:meth:`~object.__contains__`, and :meth:`~object.__reversed__`.
Types that implement this expanded
interface can be registered explicitly using
:func:`~abc.ABCMeta.register`. For more documentation on sequence
methods generally, see
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/bisect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The following functions are provided:
Insert *x* in *a* in sorted order.

This function first runs :py:func:`~bisect.bisect_left` to locate an insertion point.
Next, it runs the :meth:`!insert` method on *a* to insert *x* at the
Next, it runs the :meth:`~sequence.insert` method on *a* to insert *x* at the
appropriate position to maintain sort order.

To support inserting records in a table, the *key* function (if any) is
Expand All @@ -103,7 +103,7 @@ The following functions are provided:
entries of *x*.

This function first runs :py:func:`~bisect.bisect_right` to locate an insertion point.
Next, it runs the :meth:`!insert` method on *a* to insert *x* at the
Next, it runs the :meth:`~sequence.insert` method on *a* to insert *x* at the
appropriate position to maintain sort order.

To support inserting records in a table, the *key* function (if any) is
Expand Down
9 changes: 5 additions & 4 deletions Doc/library/collections.abc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
ABCs for read-only and mutable :term:`sequences <sequence>`.

Implementation note: Some of the mixin methods, such as
:meth:`~container.__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make
repeated calls to the underlying :meth:`~object.__getitem__` method.
:meth:`~container.__iter__`, :meth:`~object.__reversed__`,
and :meth:`~sequence.index` make repeated calls to the underlying
:meth:`~object.__getitem__` method.
Consequently, if :meth:`~object.__getitem__` is implemented with constant
access speed, the mixin methods will have linear performance;
however, if the underlying method is linear (as it would be with a
Expand All @@ -281,8 +282,8 @@ Collections Abstract Base Classes -- Detailed Descriptions
Supporting the *start* and *stop* arguments is optional, but recommended.

.. versionchanged:: 3.5
The :meth:`!index` method added support for *stop* and *start*
arguments.
The :meth:`~sequence.index` method gained support for
the *stop* and *start* arguments.

.. class:: Set
MutableSet
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -783,10 +783,10 @@ sequence of key-value pairs into a dictionary of lists:

When each key is encountered for the first time, it is not already in the
mapping; so an entry is automatically created using the :attr:`~defaultdict.default_factory`
function which returns an empty :class:`list`. The :meth:`!list.append`
function which returns an empty :class:`list`. The :meth:`list.append`
operation then attaches the value to the new list. When keys are encountered
again, the look-up proceeds normally (returning the list for that key) and the
:meth:`!list.append` operation adds another value to the list. This technique is
:meth:`list.append` operation adds another value to the list. This technique is
simpler and faster than an equivalent technique using :meth:`dict.setdefault`:

>>> d = {}
Expand Down
5 changes: 2 additions & 3 deletions Doc/library/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -671,16 +671,15 @@ Formatter Objects
which is just the logged message.
:type fmt: str

:param datefmt: A format string in the given *style* for
the date/time portion of the logged output.
:param datefmt: A format string for the date/time portion of the logged output.
If not specified, the default described in :meth:`formatTime` is used.
:type datefmt: str

:param style: Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines
how the format string will be merged with its data: using one of
:ref:`old-string-formatting` (``%``), :meth:`str.format` (``{``)
or :class:`string.Template` (``$``). This only applies to
*fmt* and *datefmt* (e.g. ``'%(message)s'`` versus ``'{message}'``),
*fmt* (e.g. ``'%(message)s'`` versus ``'{message}'``),
not to the actual log messages passed to the logging methods.
However, there are :ref:`other ways <formatting-styles>`
to use ``{``- and ``$``-formatting for log messages.
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/pickle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ or both.
These items will be appended to the object either using
``obj.append(item)`` or, in batch, using ``obj.extend(list_of_items)``.
This is primarily used for list subclasses, but may be used by other
classes as long as they have
:ref:`append and extend methods <typesseq-common>` with
classes as long as they have :meth:`~sequence.append`
and :meth:`~sequence.extend` methods with
the appropriate signature. (Whether :meth:`!append` or :meth:`!extend` is
used depends on which pickle protocol version is used as well as the number
of items to append, so both must be supported.)
Expand Down
Loading
Loading