pep-492: Mention AsyncIterator and AsyncIterable ABCs.

This commit is contained in:
Yury Selivanov 2015-05-14 22:05:24 -04:00
parent 7396e82840
commit 7f5989e99b
1 changed files with 11 additions and 2 deletions

View File

@ -710,6 +710,14 @@ Abstract Base Classes (ABC) are added:
implement ``send(value)``, ``throw(type, exc, tb)``, and ``close()`` implement ``send(value)``, ``throw(type, exc, tb)``, and ``close()``
methods. methods.
To allow easy testing if objects support asynchronous iteration, two
more ABCs are added:
* ``collections.abc.AsyncIterable`` -- tests for ``__aiter__`` method.
* ``collections.abc.AsyncIterator`` -- tests for ``__aiter__`` and
``__anext__`` methods.
Glossary Glossary
======== ========
@ -1329,8 +1337,9 @@ List of high-level changes and new protocols
7. New ``CO_COROUTINE`` and ``CO_ITERABLE_COROUTINE`` bit flags for code 7. New ``CO_COROUTINE`` and ``CO_ITERABLE_COROUTINE`` bit flags for code
objects. objects.
8. New ABCs: ``collections.abc.Awaitable`` and 8. New ABCs: ``collections.abc.Awaitable``,
``collections.abc.Coroutine``. ``collections.abc.Coroutine``, ``collections.abc.AsyncIterable``, and
``collections.abc.AsyncIterator``.
While the list of changes and new things is not short, it is important While the list of changes and new things is not short, it is important
to understand, that most users will not use these features directly. to understand, that most users will not use these features directly.