Fate of lambda, Functional Programming in Python...

Christopher A. Craig com-nospam at ccraig.org
Fri Aug 20 15:01:04 EDT 2004


"Jared Cohen" <Jared.Cohen at noaa.gov> writes:

>   Agreed! I'm currently building a GUI in Tkinter, with event handlers and
>   callbacks all over the place. The lambda form is an absolute MUST for this
>   kind of thing!

Nobody is talking about removing the ability to pass functions, just
the actual "lambda" form.

You can still build a GUI by doing

def spam(stuff):
  def eggs(parrot):
    return 5+parrot
  return eggs

You just can't do

def spam(stuff):
  return lambda foo: 5+parrot


I can't think of a situation where you _really_ need the second (and
much more limited) form.

-- 
Christopher A. Craig <com-nospam at ccraig.org>
"The shortest distance between two points is usually torn up." Frank Walsh




More information about the Python-list mailing list