[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: map/filter/reduce/lambda opinions and background unscientific
From: Steven Bethard <steven.bethard () gmail ! com>
Date: 2005-07-08 17:03:54
Message-ID: oL-dnRYPEKJlLFPfRVn-gA () comcast ! com
[Download RAW message or body]
Christopher Subich wrote:
> Ron Adam wrote:
>> I think the association of (lambda) to [list_comp] is a nice
>> distinction. Maybe a {dictionary_comp} would make it a complete set. ;-)
>
> Yeah, dictionary comprehensions would be an interesting feature. :)
> Syntax might be a bit unwieldy, though, and I doubt they'd be used often
> enough to be worth implementing, but still neat.
Dict comprehensions were recently rejected:
http://www.python.org/peps/pep-0274.html
The reason, of course, is that dict comprehensions don't gain you much
at all over the dict() constructor plus a generator expression, e.g.:
dict((i, chr(65+i)) for i in range(4))
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic