In <[EMAIL PROTECTED]>, Christopher Subich wrote:

> Chris Mellon wrote:
>> functions with real names is crucial to maintainable code. The only
>> reason to ever use a lamdba in Python is because you don't want to
>> give a function a name, and that is just not a compelling use case for
>> GUI events.
> 
> Ah, but that neglects the sheer utility of delayed-evaluation 
> expressions.  Consider the key= parameter to list.sort, et. al:
> 
> complicated_list.sort(key=lambda x: x[3])

This can be written as::

  from operator import itemgetter
  complicated_list.sort(key=itemgetter(3))

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to