On Thu, Apr 19, 2012 at 7:12 AM, lkcl luke <luke.leigh...@gmail.com> wrote:
> On Thu, Apr 19, 2012 at 12:20 PM, Alek Storm <alek.st...@gmail.com> wrote: > > Why not use list comprehension syntax? > > because it's less characters to type, and thus less characters to > read. i find that syntax incredibly klunky. left to right you're > reading, "you declare something to be the case... and then oh whoops > actually it's not really the case because it's modified by a list > thing" - it breaks reading expectations. > > that's what i meant about beauty and elegance. the "bang per buck" > ratio in python, results obtained for the number of characters used, > is higher, and that's something that i personally find to be a > priority over speed. > Did I miss something? `[a+1 for a in some_list]` is shorter than both `map(lambda a: a+1, some_list)` and `some_list.map(lambda a: a+1)`. Alek
-- http://mail.python.org/mailman/listinfo/python-list