How about "bracket" or "bracket_with"? As in: bracket_with synchronized(lock): BLOCK
bracket_with opening("/etc/passwd") as f: for line in f: print line.rstrip() bracket_with transactional(db): db.store() bracket_with auto_retry(3, IOError): f = urllib.urlopen("http://python.org/peps/pep-0340.html") print f.read() block_with synchronized_opening("/etc/passwd", myLock) as f: for line in f: print line.rstrip() def synchronized_opening(lock, filename, mode="r"): bracket_with synchronized(lock): bracket_with opening(filename) as f: yield f bracket_with synchronized_opening("/etc/passwd", myLock) as f: for line in f: print line.rstrip() Or for that matter, "block_with", as in: block_with transactional(db): db.store() -- Luis P Caamano Atlanta, GA USA _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com