Phillip J. Eby wrote:
> My use case for throw() calls for the latter option; i.e., the exception is
> raised by the yield expression at the resumption point. Keep in mind that
> if the exception passes out of the generator, the throw() call will show in
> the traceback anyway. It's unlikely th
At 01:24 PM 5/18/2005 -0400, Raymond Hettinger wrote:
> > - g.throw(type, value, traceback) causes the specified exception to be
> > thrown at the place where the generator g is currently suspended.
>
>Are the value and traceback arguments optional as they are with the
>current raise statement? If
> [Raymond Hettinger]
> > Are the value and traceback arguments optional as they are with the
> > current raise statement? If they are optional, what would the
default
> > be? I think the preferred choice is to have the call to the throw
> > method be the anchor point. That makes sense in a trac
[Raymond Hettinger]
> Are the value and traceback arguments optional as they are with the
> current raise statement? If they are optional, what would the default
> be? I think the preferred choice is to have the call to the throw
> method be the anchor point. That makes sense in a traceback so y
> I'd like to propose to make that a separate PEP, which can combine
> elements of PEP 288 and PEP 325.
+1
Overall, the combined PEP proposal looks pretty good.
> - g.throw(type, value, traceback) causes the specified exception to be
> thrown at the place where the generator g is currently su