Issue 27598: Add Collections to collections.abc.

Patch by Ivan Levkivskyi, docs by Neil Girdhar.
This commit is contained in:
Guido van Rossum 2016-08-23 10:47:07 -07:00
parent 9ff4fb3619
commit f0666949fd
5 changed files with 132 additions and 21 deletions

View file

@ -45,10 +45,12 @@ ABC Inherits from Abstract Methods Mixin
:class:`Generator` :class:`Iterator` ``send``, ``throw`` ``close``, ``__iter__``, ``__next__``
:class:`Sized` ``__len__``
:class:`Callable` ``__call__``
:class:`Collection` :class:`Sized`, ``__contains__``,
:class:`Iterable`, ``__iter__``,
:class:`Container` ``__len__``
:class:`Sequence` :class:`Sized`, ``__getitem__``, ``__contains__``, ``__iter__``, ``__reversed__``,
:class:`Reversible`, ``__len__`` ``index``, and ``count``
:class:`Container`
:class:`Sequence` :class:`Reversible`, ``__getitem__``, ``__contains__``, ``__iter__``, ``__reversed__``,
:class:`Collection` ``__len__`` ``index``, and ``count``
:class:`MutableSequence` :class:`Sequence` ``__getitem__``, Inherited :class:`Sequence` methods and
``__setitem__``, ``append``, ``reverse``, ``extend``, ``pop``,
@ -59,9 +61,9 @@ ABC Inherits from Abstract Methods Mixin
:class:`ByteString` :class:`Sequence` ``__getitem__``, Inherited :class:`Sequence` methods
``__len__``
:class:`Set` :class:`Sized`, ``__contains__``, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
:class:`Iterable`, ``__iter__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``,
:class:`Container` ``__len__`` ``__sub__``, ``__xor__``, and ``isdisjoint``
:class:`Set` :class:`Collection` ``__contains__``, ``__le__``, ``__lt__``, ``__eq__``, ``__ne__``,
``__iter__``, ``__gt__``, ``__ge__``, ``__and__``, ``__or__``,
``__len__`` ``__sub__``, ``__xor__``, and ``isdisjoint``
:class:`MutableSet` :class:`Set` ``__contains__``, Inherited :class:`Set` methods and
``__iter__``, ``clear``, ``pop``, ``remove``, ``__ior__``,
@ -69,9 +71,9 @@ ABC Inherits from Abstract Methods Mixin
``add``,
``discard``
:class:`Mapping` :class:`Sized`, ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``,
:class:`Iterable`, ``__iter__``, ``get``, ``__eq__``, and ``__ne__``
:class:`Container` ``__len__``
:class:`Mapping` :class:`Collection` ``__getitem__``, ``__contains__``, ``keys``, ``items``, ``values``,
``__iter__``, ``get``, ``__eq__``, and ``__ne__``
``__len__``
:class:`MutableMapping` :class:`Mapping` ``__getitem__``, Inherited :class:`Mapping` methods and
``__setitem__``, ``pop``, ``popitem``, ``clear``, ``update``,
@ -106,6 +108,12 @@ ABC Inherits from Abstract Methods Mixin
ABC for classes that provide the :meth:`__iter__` method.
See also the definition of :term:`iterable`.
.. class:: Collection
ABC for sized iterable container classes.
.. versionadded:: 3.6
.. class:: Iterator
ABC for classes that provide the :meth:`~iterator.__iter__` and