On Fri, Aug 24, 2012 at 4:49 AM, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: > By the time you wrap the equation with a lambda all, named, terms, > AND supply the named terms after the lambda, you might as well just wrap > the equation in a plain try/except block.
But closures spare you that hassle. >>> a=1 >>> b=0 >>> print(safe(lambda: a/b)) 42 >>> b=2 >>> print(safe(lambda: a/b)) 0.5 (Example done in Python 3 so semantics are a little different) ChrisA -- http://mail.python.org/mailman/listinfo/python-list