On Mon, Apr 16, 2012 at 3:13 AM, Raymond Hettinger <raymond.hettinger at gmail.com> wrote: > Instead, the context manager implements a different behavior. It would > have been better if that behavior had been given a name: > > db = sqlite3.connect(filename) > with auto_commit_or_rollback(db): > # do a transaction I agree that it wants a name. If explicitness is the goal, would this be more suitable? db = sqlite3.connect(filename) with db.begin_transaction() as trans: # do a transaction This way, if a database engine supports multiple simultaneous transactions, the same syntax can be used. Chris Angelico
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4