[PEP] matching and mismatching

Alex Martelli aleax at aleax.it
Thu May 2 12:54:35 EDT 2002


Luke Kenneth Casson Leighton wrote:
        ...
> for x in ([1,3,2,5,9] matching lambda x:x > 2):

Seems quite close to:

  for x in filter(lambda x: x>2, [1, 3, 2, 5, 9]):

or

  for x in [y for y in [1, 3, 2, 5, 9] if y>2]:

I doubt we need a third way yet -- surely either
or both of these existing ones should be potentially
"parallelizable" enough for your liking?


Alex




More information about the Python-list mailing list