Need an identity operator because lambda is too slow

Sean McIlroy sean_mcilroy at yahoo.com
Sun Feb 18 21:31:53 EST 2007


On Feb 17, 9:59 pm, "Deron Meranda" <deron.mera... at gmail.com> 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

peace
stm




More information about the Python-list mailing list