Performance impact of using decorators

Alex Martelli aleaxit at yahoo.com
Fri Mar 10 22:20:34 EST 2006


Diez B. Roggisch <deets at nospam.web.de> 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...!


Alex



More information about the Python-list mailing list