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

Reply via email to