"Gary Herron" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > --snip-- > So just use a def. It is constantly pointed out on > this list that the lambda provides no extra expressive power, it is > merely a shortcut
No, it is not merely a shortcut. It often allows one to avoid polluting the namespace with a completely superfluous function name, thus reducing code smell. It can also avoid a multi-line function defintion which often pushes other relevant code off the current page and out of view, and thus lambda can increase program readability. > and, as you just found out, a rather restrictive one > at that. In part because Python's designers failed to make "print" a function or provide an if-then-else expression. > --snip-- -- http://mail.python.org/mailman/listinfo/python-list