[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: map/filter/reduce/lambda opinions and background
From: "Terry Reedy" <tjreedy () udel ! edu>
Date: 2005-07-09 0:32:08
Message-ID: dan5u9$2df$1 () sea ! gmane ! org
[Download RAW message or body]
"George Sakkis" <gsakkis@rutgers.edu> wrote in message
news:1120852274.923521.211250@g43g2000cwa.googlegroups.com...
> "Steven Bethard" <steven.bethard@gmail.com> wrote:
>> 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))
> Sure, but the same holds for list comprehensions: list(i*i for i in
> xrange(10)). The difference is historic I guess; list comprehensions
> preceded generator expressions and so they cannot be removed, at least
> not before 3.0. I wonder if they will/should be in the language when
> the constraint of backwards compatibility is lifted.
Guido has asked himself the same question. Some developers who love l.c.s
are sure they will stay. I am not. I think it might depend on whether
they have any real advantages in the context of the 3.0 engine and design,
which don't exist yet.
> IMO they should
> not (TIOOWTDI, uniformity among builtin data structures, not
> overwhelmingly more useful than set or dict comprehensions), but
> there's a long way till that day.
Yes.
Terry J. Reedy
--
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