← Back to team overview

launchpad-dev team mailing list archive

Re: The with statement

 

Aaron Bentley wrote:

One alternative to using a context manager for transactions is:

    txn = transaction.begin()
    try:
        modify_the_database()
    finally:
        # Ah, everything succeeded.
        txn.commit()

Gah!  The horror!


Jeroen



References