@@ -33,9 +33,9 @@ The collections module offers the following :term:`ABCs <abstract base class>`:
3333
3434.. tabularcolumns :: |l|L|L|L|
3535
36- ========================= ===================== ====================== ====================================================
36+ ========================== ====================== ======================= ====================================================
3737ABC Inherits from Abstract Methods Mixin Methods
38- ========================= ===================== ====================== ====================================================
38+ ========================== ====================== ======================= ====================================================
3939:class: `Container ` ``__contains__ ``
4040:class: `Hashable ` ``__hash__ ``
4141:class: `Iterable ` ``__iter__ ``
@@ -81,7 +81,11 @@ ABC Inherits from Abstract Methods Mixin
8181:class: `KeysView ` :class: `MappingView `, ``__contains__ ``,
8282 :class: `Set ` ``__iter__ ``
8383:class: `ValuesView ` :class: `MappingView ` ``__contains__ ``, ``__iter__ ``
84- ========================= ===================== ====================== ====================================================
84+ :class: `Awaitable ` ``__await__ ``
85+ :class: `Coroutine ` ``send ``, ``throw `` ``close ``
86+ :class: `AsyncIterable ` ``__aiter__ ``
87+ :class: `AsyncIterator ` :class: `AsyncIterable ` ``__anext__ `` ``__aiter__ ``
88+ ========================== ====================== ======================= ====================================================
8589
8690
8791.. class :: Container
@@ -134,6 +138,41 @@ ABC Inherits from Abstract Methods Mixin
134138
135139 ABCs for mapping, items, keys, and values :term: `views <view> `.
136140
141+ .. class :: Awaitable
142+
143+ ABC for classes that provide ``__await__ `` method. Instances
144+ of such classes can be used in ``await `` expression.
145+
146+ :term: `coroutine ` objects and instances of
147+ :class: `~collections.abc.Coroutine ` are too instances of this ABC.
148+
149+ .. versionadded :: 3.5
150+
151+ .. class :: Coroutine
152+
153+ ABC for coroutine compatible classes that implement a subset of
154+ generator methods defined in :pep: `342 `, namely:
155+ :meth: `~generator.send `, :meth: `~generator.throw ` and
156+ :meth: `~generator.close ` methods. All :class: `Coroutine ` instances
157+ are also instances of :class: `Awaitable `. See also the definition
158+ of :term: `coroutine `.
159+
160+ .. versionadded :: 3.5
161+
162+ .. class :: AsyncIterable
163+
164+ ABC for classes that provide ``__aiter__ `` method. See also the
165+ definition of :term: `asynchronous iterable `.
166+
167+ .. versionadded :: 3.5
168+
169+ .. class :: AsyncIterator
170+
171+ ABC for classes that provide ``__aiter__ `` and ``__anext__ ``
172+ methods. See also the definition of :term: `asynchronous iterator `.
173+
174+ .. versionadded :: 3.5
175+
137176
138177These ABCs allow us to ask classes or instances if they provide
139178particular functionality, for example::
0 commit comments