[Python-3000] sets in P3K?
Terry Reedy
tjreedy at udel.edu
Tue Apr 25 20:48:54 CEST 2006
"Alex Martelli" <aleaxit at gmail.com> wrote in message
news:e8a0972d0604251049x29a39d61l690608b1c005ce2b at mail.gmail.com...
> 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.
> """
When Guido posted that, I replied in support of more syntax. While I don't
share your dislike, Raymond and Josiah have somewhat neutralized my
support. I can see Raymond's point that we now have too many types to
support all with syntax. And I can see an argument that the appropriate
response to more types is a compensating decrease in syntax (as in dropping
[xx] as a synonym for list(xx)) rather than adding more.
Terry Jan Reedy
More information about the Python-3000
mailing list