Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > The canonical solution is to iterate over a list of > expression,function pairs, ie:
Although that solution is pretty, it is not the canonical solution because it doesn't cover the important case of "if" bodies needing to access common variables in the enclosing scope. (This will be easier in Python 3 with 'nonlocal', though.) The snippet posted by Diez is IMHO closer to a canonical solution to this FAQ. -- http://mail.python.org/mailman/listinfo/python-list