pep-0492: Mention new ABC classes.

This commit is contained in:
Yury Selivanov 2015-05-13 18:44:41 -04:00
parent 1afe7c75fc
commit a102d98921
1 changed files with 21 additions and 0 deletions

View File

@ -696,6 +696,21 @@ New Standard Library Functions
thread-specific. See `Debugging Features`_ for more details.
New Abstract Base Classes
-------------------------
In order to allow better integration with existing frameworks (such as
Tornado, see [13]_) and compilers (such as Cython, see [16]_), two new
Abstract Base Classes (ABC) are added:
* ``collections.abc.Awaitable`` ABC for *Future-like* classes, that
implement ``__await__`` method.
* ``collections.abc.Coroutine`` ABC for *coroutine* objects, that
implement ``send(value)``, ``throw(type, exc, tb)``, and ``close()``
methods.
Glossary
========
@ -1314,6 +1329,9 @@ List of high-level changes and new protocols
7. New ``CO_COROUTINE`` and ``CO_ITERABLE_COROUTINE`` bit flags for code
objects.
8. New ABCs: ``collections.abc.Awaitable`` and
``collections.abc.Coroutine``.
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.
It is intended to be used in frameworks and libraries to provide users
@ -1396,10 +1414,13 @@ References
.. [12] https://docs.python.org/3/reference/expressions.html#primaries
.. [13] https://mail.python.org/pipermail/python-dev/2015-May/139851.html
.. [14] https://mail.python.org/pipermail/python-dev/2015-May/139844.html
.. [15] http://bugs.python.org/issue24017
.. [16] https://github.com/python/asyncio/issues/233
Acknowledgments
===============