I sing the praises of lambda, my friend and savior!

Cliff Wells clifford.wells at comcast.net
Wed Oct 13 20:14:49 CEST 2004


On Wed, 2004-10-13 at 10:58 -0700, Jeff Shannon wrote:
> Antoon Pardon wrote:
> 
> >Op 2004-10-12, Jeff Shannon schreef <jeff at ccvcorp.com>:
> >  
> >
> >>Functions are at a different level of granularity than numbers and 
> >>lists.  Anonymity makes sense for numbers and lists; it makes less sense 
> >>for collections of numbers and lists; and it makes still less sense for 
> >>organized collections of numbers, lists, and operations thereon, which 
> >>are structured in a meaningful way to express some (part of an) 
> >>algorithm.
> >>

Hi Jeff,

Jumping in way late in this thread, I'll toss in my pennies and say I
still use lambda fairly regularly in one place, and it just happens to
be the very place where I learned of lambda in the first place: event
handlers for GUI programming.  I first learned the technique in Tkinter
circa 1.5.2 and still use it in wxPython.  It isn't strictly necessary,
but given the already cluttered nature of GUI programming, I'm pretty
reluctant to toss in four or five more names every time I want a
complicated event handler to get called with slightly different
arguments. Basically I use it as a poor-man's curry (if I understand
currying correctly, I've only seen conversations about it on this list
and that's the impression I was left with: that it's a way of providing
variations in the default arguments to a function).

As I know you're a wxPython user as well, I'd be curious to know how you
approach this particular problem.

Regards,
Cliff

-- 
Cliff Wells <clifford.wells at comcast.net>




More information about the Python-list mailing list