[Python-Dev] PEP 340: Breaking out.

Nicolas Fleury nidoizo at yahoo.com
Fri May 6 14:33:29 CEST 2005


Guido van Rossum wrote:
>>Maybe generators are not the way to go, but could be
>>supported natively by providing a __block__ function, very similarly to
>>sequences providing an __iter__ function for for-loops?
> 
> Sorry, I have no idea what you are proposing here.

I was suggesting that the feature could be a PEP310-like object and that 
a __block__ function (or whatever) of the generator could return such an 
object.  But at this point, Nick's proposition is what I prefer.  I find 
the use of generators very elegant, but I'm still unconvinced it is a 
good idea to use them to implement an acquire/release pattern.  Even if 
another continuation mechanism would be used (like Steven's idea), it 
would still be a lot of concepts used to implement acquire/release.

Regards,
Nicolas



More information about the Python-Dev mailing list