Framework for a beginner

Alek Storm alek.storm at gmail.com
Thu Apr 19 08:21:14 EDT 2012


On Thu, Apr 19, 2012 at 7:12 AM, lkcl luke <luke.leighton at gmail.com> wrote:

> On Thu, Apr 19, 2012 at 12:20 PM, Alek Storm <alek.storm at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120419/64621f1b/attachment-0001.html>


More information about the Python-list mailing list