From a102d98921aba59385b09fae74de233316dcddbd Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 13 May 2015 18:44:41 -0400 Subject: [PATCH] pep-0492: Mention new ABC classes. --- pep-0492.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pep-0492.txt b/pep-0492.txt index b5db773a0..d11933a15 100644 --- a/pep-0492.txt +++ b/pep-0492.txt @@ -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 ===============