Performance impact of using decorators

Alex Martelli aleaxit at
Sat Mar 11 04:20:34 CET 2006

Diez B. Roggisch <deets at> wrote:
> begin()
> try:
>   pass
>   commit()
> finally:
>   if not comitted():
>     rollback()

Feels like a natural for 2.5's 'with' statement -- as has been the case
for 2.3 and 2.4, 2.5 won't have many language-level changes, but what
little there IS, is... wonderful!

with transaction():
   ...your code goes here...

is SO much better than the try/finally routine...!


More information about the Python-list mailing list