[Python-Dev] A Hygienic Macro System in Python? (original) (raw)
Patrick K. O'Brien pobrien@orbtech.com
Tue, 19 Mar 2002 08:01:50 -0600
- Previous message: [Python-Dev] A Hygienic Macro System in Python?
- Next message: [Python-Dev] A Hygienic Macro System in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The pure Python version doesn't seem too bad.
def transact(call): if not callable(call): raise TypeError doc.BeginTransaction() try: try: call() except: # an error occurred part way through. make sure everything # is reverted (sort of a rollback) doc.AbortTransaction() finally: doc.EndTransaction()
def something(): pass
transact(something)
Patrick K. O'Brien Orbtech
- Previous message: [Python-Dev] A Hygienic Macro System in Python?
- Next message: [Python-Dev] A Hygienic Macro System in Python?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]