is already executing raises a :exc:`ValueError` exception.
.. index:: exception: StopIteration
-.. class:: generator
.. method:: generator.__next__()
:meth:`~generator.__next__` method, the current yield expression always
evaluates to :const:`None`. The execution then continues to the next yield
expression, where the generator is suspended again, and the value of the
- :token:`expression_list` is returned to :meth:`next`'s caller. If the
+ :token:`expression_list` is returned to :meth:`__next__`'s caller. If the
generator exits without yielding another value, a :exc:`StopIteration`
exception is raised.
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.
-.. class:: .
-
.. index:: single: yield; examples
Examples