summaryrefslogtreecommitdiff
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-12-15 17:36:05 -0500
committerYury Selivanov <yury@magic.io>2016-12-15 17:36:05 -0500
commit03660041d2d3a95e7bc4ad863278bd93e28c805e (patch)
tree601e278203f1e710c1a0bef12e8e9b82336f14e0 /Doc/glossary.rst
parent76febd079299d64abffee0bdd7c4c1785e5a0fa7 (diff)
downloadcpython-git-03660041d2d3a95e7bc4ad863278bd93e28c805e.tar.gz
Issue #28091: Document PEP 525 & PEP 530.
Patch by Eric Appelt.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst28
1 files changed, 28 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index f80b6df212..41ee3d83b3 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -74,6 +74,34 @@ Glossary
:keyword:`async with` statement by defining :meth:`__aenter__` and
:meth:`__aexit__` methods. Introduced by :pep:`492`.
+ asynchronous generator
+ A function which returns an :term:`asynchronous generator iterator`. It
+ looks like a coroutine function defined with :keyword:`async def` except
+ that it contains :keyword:`yield` expressions for producing a series of
+ values usable in an :keyword:`async for` loop.
+
+ Usually refers to a asynchronous generator function, but may refer to an
+ *asynchronous generator iterator* in some contexts. In cases where the
+ intended meaning isn't clear, using the full terms avoids ambiguity.
+
+ An asynchronous generator function may contain :keyword:`await`
+ expressions as well as :keyword:`async for`, and :keyword:`async with`
+ statements.
+
+ asynchronous generator iterator
+ An object created by a :term:`asynchronous generator` function.
+
+ This is an :term:`asynchronous iterator` which when called using the
+ :meth:`__anext__` method returns an awaitable object which will execute
+ that the body of the asynchronous generator function until the
+ next :keyword:`yield` expression.
+
+ Each :keyword:`yield` temporarily suspends processing, remembering the
+ location execution state (including local variables and pending
+ try-statements). When the *asynchronous generator iterator* effectively
+ resumes with another awaitable returned by :meth:`__anext__`, it
+ picks-up where it left-off. See :pep:`492` and :pep:`525`.
+
asynchronous iterable
An object, that can be used in an :keyword:`async for` statement.
Must return an :term:`asynchronous iterator` from its