[Python-checkins] cpython (3.5): Issue #24400: Mention that __instancecheck__ is used in abc.Awaitable and
yury.selivanov
python-checkins at python.org
Wed Jul 1 18:49:22 CEST 2015
https://hg.python.org/cpython/rev/b2a3baa1c2b0
changeset: 96746:b2a3baa1c2b0
branch: 3.5
parent: 96744:a9d38701536d
user: Yury Selivanov <yselivanov at sprymix.com>
date: Wed Jul 01 12:49:00 2015 -0400
summary:
Issue #24400: Mention that __instancecheck__ is used in abc.Awaitable and Coroutine
files:
Doc/conf.py | 2 +-
Doc/library/collections.abc.rst | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/Doc/conf.py b/Doc/conf.py
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -44,7 +44,7 @@
# -----------------------
# Use our custom theme.
-html_theme = 'pydoctheme'
+html_theme = 'classic'
html_theme_path = ['tools']
html_theme_options = {'collapsiblesidebar': True}
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -161,6 +161,12 @@
:term:`Coroutine` objects and instances of the
:class:`~collections.abc.Coroutine` ABC are all instances of this ABC.
+ .. note::
+ In CPython, generator-based coroutines are *awaitables*, even though
+ they do not have an :meth:`__await__` method. This ABC
+ implements an :meth:`~class.__instancecheck__` method to make them
+ instances of itself.
+
.. versionadded:: 3.5
.. class:: Coroutine
@@ -172,6 +178,12 @@
:meth:`__await__`. All :class:`Coroutine` instances are also instances of
:class:`Awaitable`. See also the definition of :term:`coroutine`.
+ .. note::
+ In CPython, generator-based coroutines are *awaitables* and *coroutines*,
+ even though they do not have an :meth:`__await__` method. This ABC
+ implements an :meth:`~class.__instancecheck__` method to make them
+ instances of itself.
+
.. versionadded:: 3.5
.. class:: AsyncIterable
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list