[Python-Dev] PEP 341 patch & memory management (was: Memory management in the AST parser & compiler)

Thomas Lee krumms at gmail.com
Tue Nov 15 14:17:13 CET 2005


Interesting trick!

The PEP 341 patch is now using Marek's 'do ... while' resource cleanup 
trick instead of the nasty goto voodoo.

I've also fixed the last remaining bug that Neal pointed out. I'm 
running the unit tests right now, shall have the updated (and hopefully 
final) PEP 341 patch up on sourceforge within the next 15 minutes.

If anybody has feedback/suggestions for the patch, please let me know. 
I'm new to this stuff, so I'm still finding my way around :)

Cheers,
Tom

Nick Coghlan wrote:

>Marek Baczek Baczyński wrote:
>  
>
>>2005/11/15, Nick Coghlan <ncoghlan at iinet.net.au>:
>>    
>>
>>>It avoids the potential for labelling problems that arises when goto's are
>>>used for resource cleanup. It's a far cry from real exception handling, but
>>>it's the best solution I've seen within the limits of C.
>>>      
>>>
>><delurk>
>>do {
>>    ....
>>    ....
>>} while (0);
>>
>>
>>Same benefit and saves some typing :)
>>    
>>
>
>Heh. Good point. I spend so much time working with a certain language I tend 
>to forget do/while loops exist ;)
>
>Cheers,
>Nick.
>
>  
>



More information about the Python-Dev mailing list