diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -222,19 +222,17 @@ type objects) *must* have the :attr:`ob_ .. c:member:: void* PyTypeObject.tp_as_async Pointer to an additional structure that contains fields relevant only to objects which implement :term:`awaitable` and :term:`asynchronous iterator` 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 .. index:: builtin: repr An optional pointer to a function that implements the built-in function :func:`repr`. @@ -1344,16 +1342,17 @@ Buffer Object Structures .. _async-structs: Async Object Structures ======================= .. sectionauthor:: Yury Selivanov +.. versionadded:: 3.5 .. c:type:: PyAsyncMethods This structure holds pointers to the functions required to implement :term:`awaitable` and :term:`asynchronous iterator` objects. Here is the structure definition:: diff --git a/Doc/glossary.rst b/Doc/glossary.rst --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -69,47 +69,39 @@ Glossary :ref:`the difference between arguments and parameters `, and :pep:`362`. asynchronous context manager An object which controls the environment seen in an :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. :keyword:`async for` resolves awaitable returned from asynchronous 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* it would be referenced as *o.a*. awaitable An object that can be used in an :keyword:`await` expression. Can be 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 `_, Python's creator. binary file A :term:`file object` able to read and write :term:`bytes-like objects `. @@ -178,27 +170,23 @@ Glossary See :pep:`343`. coroutine function A function which returns a :term:`coroutine` object. It is defined with an :keyword:`async def` keyword, and may contain :keyword:`await`, :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 entered, exited, and resumed at many different points. See :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 `_. The term "CPython" is used when necessary to distinguish this implementation from others such as Jython or IronPython. decorator A function returning another function, usually applied as a function diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -323,17 +323,16 @@ The following exceptions are the excepti Introduced the RuntimeError transformation. .. exception:: StopAsyncIteration Must be raised by :meth:`__anext__` method of an :term:`asynchronous iterator` object to stop the iteration. .. versionadded:: 3.5 - See also :pep:`492`. .. exception:: SyntaxError Raised when the parser encounters a syntax error. This may occur in an :keyword:`import` statement, in a call to the built-in functions :func:`exec` or :func:`eval`, or when reading the initial script or standard input (also interactively). diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -263,51 +263,49 @@ attributes: .. function:: isgenerator(object) Return true if the object is a generator. .. 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` or :func:`asyncio.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 .. function:: isawaitable(object) 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 .. function:: istraceback(object) Return true if the object is a traceback.