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 violation of finally's purpose to bear." from 
https://www.python.org/dev/peps/pep-0255/

But, meanwhile, the code showed on that page use yield in a try/finally case.
It really puzzles me. Is there anything wrong?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to