A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/021449.html below:

[Python-Dev] A Hygienic Macro System in Python?

[Python-Dev] A Hygienic Macro System in Python? [Python-Dev] A Hygienic Macro System in Python?Patrick K. O'Brien pobrien@orbtech.com
Tue, 19 Mar 2002 08:01:50 -0600
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



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