En Sun, 18 Feb 2007 23:31:53 -0300, Sean McIlroy <[EMAIL PROTECTED]> escribió:
> On Feb 17, 9:59 pm, "Deron Meranda" <[EMAIL PROTECTED]> wrote: > [snip] > > this may be really dense, but i'm curious what's wrong with the > "multiplexer" idiom: > > for item in some_sequence: > item2 = (not some_rare_condition and item) or \ > (some_rare_condition and > some_transform_function(item)) > ..... # more stuff The main concern of the OP was that lambda x:x is slow, so it's better to move the condition out of the loop. Also, this and/or trick does not work when the Boolean value of item is false (like 0, (), []...) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list