Skip to content

Commit f808d32

Browse files
AA-TurnerStanFromIreland
authored andcommitted
[3.13] GH-138562: Remove sort() from the common sequence methods in the data model (GH-138563)
(cherry picked from commit d0c9943) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 2d29aa2 commit f808d32

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Doc/reference/datamodel.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,17 +3092,20 @@ objects. The :mod:`collections.abc` module provides a
30923092
:term:`abstract base class` to help create those methods from a base set of
30933093
:meth:`~object.__getitem__`, :meth:`~object.__setitem__`,
30943094
:meth:`~object.__delitem__`, and :meth:`!keys`.
3095-
Mutable sequences should provide methods :meth:`~sequence.append`,
3096-
:meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
3097-
:meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
3098-
:meth:`~sequence.reverse` and :meth:`~sequence.sort`,
3095+
3096+
Mutable sequences should provide methods
3097+
:meth:`~sequence.append`, :meth:`~sequence.clear`, :meth:`~sequence.count`,
3098+
:meth:`~sequence.extend`, :meth:`~sequence.index`, :meth:`~sequence.insert`,
3099+
:meth:`~sequence.pop`, :meth:`~sequence.remove`, and :meth:`~sequence.reverse`,
30993100
like Python standard :class:`list` objects.
31003101
Finally, sequence types should implement addition (meaning concatenation) and
31013102
multiplication (meaning repetition) by defining the methods
31023103
:meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object.__iadd__`,
31033104
:meth:`~object.__mul__`, :meth:`~object.__rmul__` and :meth:`~object.__imul__`
31043105
described below; they should not define other numerical
3105-
operators. It is recommended that both mappings and sequences implement the
3106+
operators.
3107+
3108+
It is recommended that both mappings and sequences implement the
31063109
:meth:`~object.__contains__` method to allow efficient use of the ``in``
31073110
operator; for
31083111
mappings, ``in`` should search the mapping's keys; for sequences, it should

0 commit comments

Comments
 (0)