It's heartening to see that lambda functions (once slated to be abolished) have been given a reprieve. Otherwise there would have been no concise way of passing anonymous functions as a data type, and instead of being able to do something like (to quote a rather silly example):
greeters = { 'english' : lambda name: "Hello, %s"%name, 'french' : lambda name: "Bonjour, %s"%name, 'australian' : lambda name: "G'day, %s"%name }one would have to take the long way around, doing something like:
def greet_english(name): return "Hello, %s"%name def greet_french(name): return "Bonjour, %s"%name def greet_australian(name): return "G'day, %s"%name greeters = { 'english': greet_english, ... }And I don't buy the argument that anonymous functions are bad form, and that each chunk of code should have a name that describes what it does. There are many instances where one wants to specify a tiny fragment of code which will fit into a larger mechanism like a small but crucial cog (be it in a function call, a data structure or wherever), without the bureaucratic overhead of giving it a name. Otherwise we may as well be programming in Java or COBOL or some Vogon-designed abomination of a language.
No idea; try a Google search.
Interesting blog! I was curious as to where I could find more of I Want A Hovercraft as their page linked from the wikipedia article you wrote is broken. Thanks!