[Python-3000] sets in P3K?

Brett Cannon brett at python.org
Tue Apr 25 21:36:06 CEST 2006


On 4/25/06, Alex Martelli <aleaxit at gmail.com> wrote:
> On 4/25/06, Josiah Carlson <jcarlson at uci.edu> wrote:
>    ...
> > If list comprehensions didn't come first (and even though list
> > comprehensions came first), I would argue that there should only be
> > generator expressions.  If one wants a list comprehension, one should
> > use list(genexp).  Obviously it would have clear implications of the
> > non-starting of {genexp} for set, frozenset, and/or dict comprehensions.
>
> I entirely agree, as, it appears to me from his posts to this thread,
> does Raymond; however, Guido thinks our shared preference is atypical,
> as he posted on this thread 24 hours ago:
> """
> On 4/24/06, Alex Martelli <aleaxit at gmail.com> wrote:
> > I dislike that as much as I dislike [<genexp>] as a shorthand for
> > list(<genexp>), but I have no trouble admitting that if we have the
> > [...] form, it's consistent to have the {...} one too.
>
> I think you're atypical in that dislike.
> """
>
> I'm not sure if it really matters at all (to Guido's decision) whether
> this preference is more widespread than he thinks, or just an atypical
> quirk shared just by Carlson, Hettinger and Martelli; if it does
> matter, I guess that organizing some kind of "straw popularity poll"
> is not too hard.
>

I'll toss in my straw; I have no issue losing listcomps and favoring
``list(genexp)``.  TOOWTDI since there is not that huge of a "simple
over complex" savings.  Probably never thought about this since I
really got into Python when listcomps were introduced so they happen
to be heavily ingrained into my Python psyche.

-Brett


More information about the Python-3000 mailing list