Why is lambda allowed as a key in a dict?
iainking at gmail.com
Tue Mar 10 11:09:53 CET 2009
On Mar 10, 6:38 am, Daniel Fetchinson <fetchin... at googlemail.com>
> On 3/9/09, bearophileH... at lycos.com <bearophileH... at lycos.com> wrote:
> > See here Daniel Fetchinson:
> > But be quite careful in using that stuff, it has some traps.
> Thanks a lot for all the helpful replies!
> Yes, I should name the unnamed lambda function, or better, just use 'def'.
> Psss, psss, put it down! -http://www.cafepress.com/putitdown
Sort of tangenitally; is there any real difference between the outcome
of the two following pieces of code?
a = lambda x: x+2
More information about the Python-list