Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info>: > E.g. out of the following: > > [len(x)+1 for x in sequence] > > list(map(lambda x: len(x) + 1, sequence)) > > the first will probably be faster as well as easier to read and write.
It's mostly about idioms. Comprehensions belong to Python's core idioms, lambdas don't. In Scheme, I think it's the other way around. Too many Scheme programmers are infatuated with Scheme's powerful macros and bury Scheme's idiomatic, functional core under truckloads of foreign patterns -- just because they can. So use lambda in Scheme as much as you can. Avoid lambda in Python as much as you can. Marko -- https://mail.python.org/mailman/listinfo/python-list