Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ef2b46

Browse files
committed
#10617: merge with 3.1.
2 parents 987403b + 9b2e67c commit 7ef2b46

1 file changed

Lines changed: 50 additions & 8 deletions

File tree

Doc/library/collections.rst

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -964,10 +964,10 @@ attribute.
964964
ABCs - abstract base classes
965965
----------------------------
966966

967-
The collections module offers the following ABCs:
967+
The collections module offers the following :term:`ABCs <abstract base class>`:
968968

969969
========================= ===================== ====================== ====================================================
970-
ABC Inherits Abstract Methods Mixin Methods
970+
ABC Inherits from Abstract Methods Mixin Methods
971971
========================= ===================== ====================== ====================================================
972972
:class:`Container` ``__contains__``
973973
:class:`Hashable` ``__hash__``
@@ -980,35 +980,77 @@ ABC Inherits Abstract Methods Mixin
980980
:class:`Iterable`, ``index``, and ``count``
981981
:class:`Container`
982982

983-
:class:`MutableSequence` :class:`Sequence` ``__setitem__`` Inherited Sequence methods and
983+
:class:`MutableSequence` :class:`Sequence` ``__setitem__``, Inherited :class:`Sequence` methods and
984984
``__delitem__``, ``append``, ``reverse``, ``extend``, ``pop``,
985-
and ``insert`` ``remove``, and ``__iadd__``
985+
``insert`` ``remove``, and ``__iadd__``
986986

987987
:class:`Set` :class:`Sized`, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
988988
:class:`Iterable`, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``,
989989
:class:`Container` ``__sub__``, ``__xor__``, and ``isdisjoint``
990990

991-
:class:`MutableSet` :class:`Set` ``add`` and Inherited Set methods and
991+
:class:`MutableSet` :class:`Set` ``add``, Inherited :class:`Set` methods and
992992
``discard`` ``clear``, ``pop``, ``remove``, ``__ior__``,
993993
``__iand__``, ``__ixor__``, and ``__isub__``
994994

995995
:class:`Mapping` :class:`Sized`, ``__getitem__`` ``__contains__``, ``keys``, ``items``, ``values``,
996996
:class:`Iterable`, ``get``, ``__eq__``, and ``__ne__``
997997
:class:`Container`
998998

999-
:class:`MutableMapping` :class:`Mapping` ``__setitem__`` and Inherited Mapping methods and
999+
:class:`MutableMapping` :class:`Mapping` ``__setitem__``, Inherited :class:`Mapping` methods and
10001000
``__delitem__`` ``pop``, ``popitem``, ``clear``, ``update``,
10011001
and ``setdefault``
10021002

10031003

10041004
:class:`MappingView` :class:`Sized` ``__len__``
1005-
:class:`KeysView` :class:`MappingView`, ``__contains__``,
1006-
:class:`Set` ``__iter__``
10071005
:class:`ItemsView` :class:`MappingView`, ``__contains__``,
10081006
:class:`Set` ``__iter__``
1007+
:class:`KeysView` :class:`MappingView`, ``__contains__``,
1008+
:class:`Set` ``__iter__``
10091009
:class:`ValuesView` :class:`MappingView` ``__contains__``, ``__iter__``
10101010
========================= ===================== ====================== ====================================================
10111011

1012+
1013+
.. class:: Container
1014+
Hashable
1015+
Sized
1016+
Callable
1017+
1018+
ABCs for classes that provide respectively the methods :meth:`__contains__`,
1019+
:meth:`__hash__`, :meth:`__len__`, and :meth:`__call__`.
1020+
1021+
.. class:: Iterable
1022+
1023+
ABC for classes that provide the :meth:`__iter__` method.
1024+
See also the definition of :term:`iterable`.
1025+
1026+
.. class:: Iterator
1027+
1028+
ABC for classes that provide the :meth:`__iter__` and :meth:`next` methods.
1029+
See also the definition of :term:`iterator`.
1030+
1031+
.. class:: Sequence
1032+
MutableSequence
1033+
1034+
ABCs for read-only and mutable :term:`sequences <sequence>`.
1035+
1036+
.. class:: Set
1037+
MutableSet
1038+
1039+
ABCs for read-only and mutable sets.
1040+
1041+
.. class:: Mapping
1042+
MutableMapping
1043+
1044+
ABCs for read-only and mutable :term:`mappings <mapping>`.
1045+
1046+
.. class:: MappingView
1047+
ItemsView
1048+
KeysView
1049+
ValuesView
1050+
1051+
ABCs for mapping, items, keys, and values :term:`views <view>`.
1052+
1053+
10121054
These ABCs allow us to ask classes or instances if they provide
10131055
particular functionality, for example::
10141056

0 commit comments

Comments
 (0)