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

Skip to content

Commit cc1d028

Browse files
committed
Issue #24400: Mention that __instancecheck__ is used in abc.Awaitable and Coroutine
1 parent f270152 commit cc1d028

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# -----------------------
4545

4646
# Use our custom theme.
47-
html_theme = 'pydoctheme'
47+
html_theme = 'classic'
4848
html_theme_path = ['tools']
4949
html_theme_options = {'collapsiblesidebar': True}
5050

Doc/library/collections.abc.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ ABC Inherits from Abstract Methods Mixin
161161
:term:`Coroutine` objects and instances of the
162162
:class:`~collections.abc.Coroutine` ABC are all instances of this ABC.
163163

164+
.. note::
165+
In CPython, generator-based coroutines are *awaitables*, even though
166+
they do not have an :meth:`__await__` method. This ABC
167+
implements an :meth:`~class.__instancecheck__` method to make them
168+
instances of itself.
169+
164170
.. versionadded:: 3.5
165171

166172
.. class:: Coroutine
@@ -172,6 +178,12 @@ ABC Inherits from Abstract Methods Mixin
172178
:meth:`__await__`. All :class:`Coroutine` instances are also instances of
173179
:class:`Awaitable`. See also the definition of :term:`coroutine`.
174180

181+
.. note::
182+
In CPython, generator-based coroutines are *awaitables* and *coroutines*,
183+
even though they do not have an :meth:`__await__` method. This ABC
184+
implements an :meth:`~class.__instancecheck__` method to make them
185+
instances of itself.
186+
175187
.. versionadded:: 3.5
176188

177189
.. class:: AsyncIterable

0 commit comments

Comments
 (0)