Locking and try/finally

Dan L. Pierson dan at control.com
Thu Dec 5 09:47:07 EST 2002


On Wed, 04 Dec 2002 14:19:10 +0000, Jeremy Yallop wrote:

> Daniel Dittmar wrote:

> If Python were Common Lisp (with macros and unwind-protect) then one
> could write:
> 
>    (with-lock-held (lock)
>       (fancy-stuff)
>       (more-fancy-stuff))

Yep.  This (and similar with-* macros) is the single "feature" of
Lisp I miss most in Python.  The with-* convention is a perfect
case of the Pythonic principle of "the obvious way should be the
best way" -- being Lisp, it omits the part about it also being
the only way :-)



More information about the Python-list mailing list