Re: yield in try/finally case

2016-03-03 Thread
在 2016年3月3日星期四 UTC+8下午8:14:29,Oscar Benjamin写道: > On 3 March 2016 at 11:52, 刘琦帆 wrote: > > > > "A yield statement is not allowed in the try clause of a try/finally > > construct. The difficulty is that there's no guarantee the generator will > > ever be

yield in try/finally case

2016-03-03 Thread
I have just saw PEP 255, and it says that "A yield statement is not allowed in the try clause of a try/finally construct. The difficulty is that there's no guarantee the generator will ever be resumed, hence no guarantee that the finally block will ever get executed; that's too much a violati