Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Greg Ewing
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

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Phillip J. Eby
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

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Raymond Hettinger
> [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

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Guido van Rossum
[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

Re: [Python-Dev] Combining the best of PEP 288 and PEP 325: generatorexceptions and cleanup

2005-05-18 Thread Raymond Hettinger
> 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