Re: about lambda

2005-11-20 Thread Rick Wotnaz
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Shi Mu wrote: >> what does the following code mean? It is said to be used in the >> calculation of the overlaid area size between two polygons. >> map(lambda x:b.setdefault(x,[]),a) > > The equivalent of : > > def oh_

Re: about lambda

2005-11-20 Thread Duncan Booth
Shi Mu wrote: > what does the following code mean? It is said to be used in the > calculation of the overlaid area size between two polygons. > map(lambda x:b.setdefault(x,[]),a) > > Thanks! Assuming b is a dict, it is roughly equivalent to the following (except that the variables beginning wit

Re: about lambda

2005-11-20 Thread [EMAIL PROTECTED]
Shi Mu wrote: > what does the following code mean? It is said to be used in the > calculation of the overlaid area size between two polygons. > map(lambda x:b.setdefault(x,[]),a) The equivalent of : def oh_my_yet_another_function_name_why_not_use_lambda(x): b.setdefault(x,[]) map(oh_my_yet_an