Link to "yield from" examples in yield documentation.
This commit also simplifies the more advanced "yield from" example and removes
unused function parameters.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 41523cb..429fee4 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -320,7 +320,8 @@
yield_atom: "(" `yield_expression` ")"
yield_expression: "yield" [`expression_list` | "from" `expression`]
-The :keyword:`yield` expression is only used when defining a generator function,
+The :keyword:`yield` expression is only used when defining a :term:`generator`
+function,
and can only be used in the body of a function definition. Using a
:keyword:`yield` expression in a function definition is sufficient to cause that
definition to create a generator function instead of a normal function.
@@ -438,6 +439,12 @@
other exception, it is propagated to the caller. :meth:`close` does nothing
if the generator has already exited due to an exception or normal exit.
+
+.. index:: single: yield; examples
+
+Examples
+^^^^^^^^
+
Here is a simple example that demonstrates the behavior of generators and
generator functions::
@@ -465,6 +472,9 @@
>>> generator.close()
Don't forget to clean up when 'close()' is called.
+For examples using ``yield from``, see :ref:`pep-380` in "What's New in
+Python."
+
.. seealso::