mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add missing ABCs to list.
This commit is contained in:
parent
1a664419bb
commit
dbc5987e2f
1 changed files with 44 additions and 36 deletions
|
@ -46,24 +46,15 @@ ABCs - abstract base classes
|
|||
|
||||
The collections module offers the following ABCs:
|
||||
|
||||
========================= ==================== ====================== ====================================================
|
||||
========================= ===================== ====================== ====================================================
|
||||
ABC Inherits Abstract Methods Mixin Methods
|
||||
========================= ==================== ====================== ====================================================
|
||||
========================= ===================== ====================== ====================================================
|
||||
:class:`Container` ``__contains__``
|
||||
:class:`Hashable` ``__hash__``
|
||||
:class:`Iterable` ``__iter__``
|
||||
:class:`Iterator` :class:`Iterable` ``__next__`` ``__iter__``
|
||||
:class:`Sized` ``__len__``
|
||||
|
||||
:class:`Mapping` :class:`Sized`, ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``,
|
||||
:class:`Iterable`, ``__len__``. and ``get``, ``__eq__``, and ``__ne__``
|
||||
:class:`Container` ``__iter__``
|
||||
|
||||
:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and
|
||||
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
|
||||
``__delitem__``, and ``setdefault``
|
||||
``__iter__``, and
|
||||
``__len__``
|
||||
:class:`Callable` ``__call__``
|
||||
|
||||
:class:`Sequence` :class:`Sized`, ``__getitem__`` ``__contains__``. ``__iter__``, ``__reversed__``.
|
||||
:class:`Iterable`, and ``__len__`` ``index``, and ``count``
|
||||
|
@ -81,7 +72,24 @@ ABC Inherits Abstract Methods Mixin M
|
|||
:class:`MutableSet` :class:`Set` ``add`` and Inherited Set methods and
|
||||
``discard`` ``clear``, ``pop``, ``remove``, ``__ior__``,
|
||||
``__iand__``, ``__ixor__``, and ``__isub__``
|
||||
========================= ==================== ====================== ====================================================
|
||||
|
||||
:class:`Mapping` :class:`Sized`, ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``,
|
||||
:class:`Iterable`, ``__len__``. and ``get``, ``__eq__``, and ``__ne__``
|
||||
:class:`Container` ``__iter__``
|
||||
|
||||
:class:`MutableMapping` :class:`Mapping` ``__getitem__`` Inherited Mapping methods and
|
||||
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
|
||||
``__delitem__``, and ``setdefault``
|
||||
``__iter__``, and
|
||||
``__len__``
|
||||
|
||||
:class:`MappingView` :class:`Sized` ``__len__``
|
||||
:class:`KeysView` :class:`MappingView`, ``__contains__``,
|
||||
:class:`Set` ``__iter__``
|
||||
:class:`ItemsView` :class:`MappingView`, ``__contains__``,
|
||||
:class:`Set` ``__iter__``
|
||||
:class:`ValuesView` :class:`MappingView` ``__contains__``, ``__iter__``
|
||||
========================= ===================== ====================== ====================================================
|
||||
|
||||
These ABCs allow us to ask classes or instances if they provide
|
||||
particular functionality, for example::
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue