@@ -556,14 +556,27 @@ is already executing raises a :exc:`ValueError` exception.
556556 could receive the value.
557557
558558
559- .. method :: generator.throw(type[, value[, traceback]])
559+ .. method :: generator.throw(value)
560+ generator.throw(type[, value[, traceback]])
560561
561- Raises an exception of type `` type `` at the point where the generator was paused,
562+ Raises an exception at the point where the generator was paused,
562563 and returns the next value yielded by the generator function. If the generator
563564 exits without yielding another value, a :exc: `StopIteration ` exception is
564565 raised. If the generator function does not catch the passed-in exception, or
565566 raises a different exception, then that exception propagates to the caller.
566567
568+ In typical use, this is called with a single exception instance similar to the
569+ way the :keyword: `raise ` keyword is used.
570+
571+ For backwards compatability, however, the second signature is
572+ supported, following a convention from older versions of Python.
573+ The *type * argument should be an exception class, and *value *
574+ should be an exception instance. If the *value * is not provided, the
575+ *type * constructor is called to get an instance. If *traceback *
576+ is provided, it is set on the exception, otherwise any existing
577+ :attr: `~BaseException.__traceback__ ` attribute stored in *value * may
578+ be cleared.
579+
567580.. index :: exception: GeneratorExit
568581
569582
0 commit comments