Skip to content

Commit 73d3442

Browse files
committed
Add clear()
1 parent 27b53a0 commit 73d3442

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Doc/reference/datamodel.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,16 +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-
and :meth:`~sequence.reverse`, like Python standard :class:`list` objects.
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`,
3150+
like Python standard :class:`list` objects.
31493151
Finally, sequence types should implement addition (meaning concatenation) and
31503152
multiplication (meaning repetition) by defining the methods
31513153
:meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object.__iadd__`,
31523154
:meth:`~object.__mul__`, :meth:`~object.__rmul__` and :meth:`~object.__imul__`
31533155
described below; they should not define other numerical
3154-
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
31553159
:meth:`~object.__contains__` method to allow efficient use of the ``in``
31563160
operator; for
31573161
mappings, ``in`` should search the mapping's keys; for sequences, it should

0 commit comments

Comments
 (0)