diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -460,12 +460,17 @@ .. method:: generator.throw(type[, value[, traceback]]) - Raises an exception of type ``type`` at the point where generator was paused, + Raises an exception at the point where the generator was paused, and returns the next value yielded by the generator function. If the generator exits without yielding another value, a :exc:`StopIteration` exception is raised. If the generator function does not catch the passed-in exception, or raises a different exception, then that exception propagates to the caller. + The interpretation of the arguments is the same as for the :keyword:`raise` + statement, where ``type`` can be either an exception class or an exception + instance and ``value`` can be :const:`None`, an exception instance, a single + argument or an argument tuple to be passed to the exception class constructor. + .. index:: exception: GeneratorExit