Python Tutorial Was: Guido's regrets: filter and map

Lulu of the Lotus-Eaters mertz at gnosis.cx
Wed Nov 27 02:18:18 EST 2002


|And it doesn't replace reduce at all -- we've yet to see a construct
|proposed to do that (aside from writing it out as an explicit loop).

  reduce = lambda func, seq:
           [(l.append(func(l[i],seq[i])),l[-1])
                           for l in [[init]]
                           for i in range(len(seq))][-1][1]


Now you've seen one :-).

Yours, Lulu...

--
---[ to our friends at TLAs (spread the word) ]--------------------------
Echelon North Korea Nazi cracking spy smuggle Columbia fissionable Stego
White Water strategic Clinton Delta Force militia TEMPEST Libya Mossad
---[ Postmodern Enterprises <mertz at gnosis.cx> ]--------------------------





More information about the Python-list mailing list