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

Commit d0c9943

Browse files
GH-138562: Remove sort() from the common sequence methods in the data model (#138563)
1 parent 6e78a53 commit d0c9943

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
@@ -3142,17 +3142,20 @@ objects. The :mod:`collections.abc` module provides a
31423142
:term:`abstract base class` to help create those methods from a base set of
31433143
:meth:`~object.__getitem__`, :meth:`~object.__setitem__`,
31443144
:meth:`~object.__delitem__`, and :meth:`!keys`.
3145-
Mutable sequences should provide methods :meth:`~sequence.append`,
3146-
:meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`,
3147-
:meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`,
3148-
:meth:`~sequence.reverse` and :meth:`!sort`,
3145+
3146+
Mutable sequences should provide methods
3147+
:meth:`~sequence.append`, :meth:`~sequence.clear`, :meth:`~sequence.count`,
3148+
:meth:`~sequence.extend`, :meth:`~sequence.index`, :meth:`~sequence.insert`,
3149+
:meth:`~sequence.pop`, :meth:`~sequence.remove`, and :meth:`~sequence.reverse`,
31493150
like Python standard :class:`list` objects.
31503151
Finally, sequence types should implement addition (meaning concatenation) and
31513152
multiplication (meaning repetition) by defining the methods
31523153
:meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object.__iadd__`,
31533154
:meth:`~object.__mul__`, :meth:`~object.__rmul__` and :meth:`~object.__imul__`
31543155
described below; they should not define other numerical
3155-
operators. It is recommended that both mappings and sequences implement the
3156+
operators.
3157+
3158+
It is recommended that both mappings and sequences implement the
31563159
:meth:`~object.__contains__` method to allow efficient use of the ``in``
31573160
operator; for
31583161
mappings, ``in`` should search the mapping's keys; for sequences, it should

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /