[Python-Dev] syntactic support for sets

Alex Martelli aleaxit at gmail.com
Thu Feb 2 23:26:30 CET 2006


On 2/1/06, Greg Wilson <gvwilson at cs.utoronto.ca> wrote:
> > Generator expressions make syntactic support irrelevant:
>
> Not when you're teaching the language to undergraduates: I haven't
> actually done the study yet (though I may this summer), but I'm willing to
> bet that allowing "math" notation for sets will more than double their
> use.  (Imagine having to write "list(1, 2, 3, 4, 5)"...)

Actually, as far as I'm concerned, I'd just love to remove the [ ... ]
notation for building lists if good ways could be found to distinguish
"a list with this one item" from "a list with the same items as this
iterable".  list(1, 2, 3) is perfectly easy to explain, more readable,
and just as likely to be used, if not more, than cryptic shorthand
[1,2,3]. "If you want APL, you know where to find it" (==on IBM's
online store, called APL2!-).


> > Accordingly,Guido rejected the braced notation for set comprehensions.
> > See:  http://www.python.org/peps/pep-0218.html
>
> "...however, the issue could be revisited for Python 3000 (see PEP 3000)."
> So I'm only 1994 years early ;-)

Don't be such a pessimist, it's ONLY 994 years to go!


Alex


More information about the Python-Dev mailing list