protocols at the C-level. See :ref:`async-structs` for details.
.. versionadded:: 3.5
-
- .. note::
- Formerly known as tp_compare and tp_reserved.
+ Formerly known as ``tp_compare`` and ``tp_reserved``.
.. c:member:: reprfunc PyTypeObject.tp_repr
.. sectionauthor:: Yury Selivanov <yselivanov@sprymix.com>
+.. versionadded:: 3.5
.. c:type:: PyAsyncMethods
:keyword:`async with` statement by defining :meth:`__aenter__` and
:meth:`__aexit__` methods. Introduced by :pep:`492`.
- .. versionadded:: 3.5
-
asynchronous iterable
An object, that can be used in an :keyword:`async for` statement.
Must return an :term:`awaitable` from its :meth:`__aiter__` method,
which should in turn be resolved in an :term:`asynchronous iterator`
object. Introduced by :pep:`492`.
- .. versionadded:: 3.5
-
asynchronous iterator
An object that implements :meth:`__aiter__` and :meth:`__anext__`
methods, that must return :term:`awaitable` objects.
iterator's :meth:`__anext__` method until it raises
:exc:`StopAsyncIteration` exception. Introduced by :pep:`492`.
- .. versionadded:: 3.5
-
attribute
A value associated with an object which is referenced by name using
dotted expressions. For example, if an object *o* has an attribute
a :term:`coroutine` or an object with an :meth:`__await__` method.
See also :pep:`492`.
- .. versionadded:: 3.5
-
BDFL
Benevolent Dictator For Life, a.k.a. `Guido van Rossum
<https://www.python.org/~guido/>`_, Python's creator.
:keyword:`async for`, and :keyword:`async with` keywords. Introduced
by :pep:`492`.
- .. versionadded:: 3.5
-
coroutine
Coroutines is a more generalized form of subroutines. Subroutines are
entered at one point and exited at another point. Coroutines, can be
:keyword:`await` expressions, and :keyword:`async for` and
:keyword:`async with` statements. See also :pep:`492`.
- .. versionadded:: 3.5
-
CPython
The canonical implementation of the Python programming language, as
distributed on `python.org <https://www.python.org>`_. The term "CPython"
.. function:: iscoroutinefunction(object)
- Return true if the object is a coroutine function.
+ Return true if the object is a :term:`coroutine function`.
Coroutine functions are defined with an ``async def`` syntax,
or are generators decorated with :func:`types.coroutine`
or :func:`asyncio.coroutine`.
- The function will return false for plain python generator
+ The function will return false for plain Python generator
functions.
- See also :pep:`492`.
-
.. versionadded:: 3.5
.. function:: iscoroutine(object)
- Return true if the object is a coroutine.
+ Return true if the object is a :term:`coroutine`.
Coroutines are results of calls of coroutine functions or
generator functions decorated with :func:`types.coroutine`
The function will return false for plain python generators.
- See also :class:`collections.abc.Coroutine` and :pep:`492`.
+ See also :class:`collections.abc.Coroutine`.
.. versionadded:: 3.5
Return true if the object can be used in :keyword:`await`
expression.
- See also :class:`collections.abc.Awaitable` and :pep:`492`.
+ See also :class:`collections.abc.Awaitable`.
.. versionadded:: 3.5