[Python-ideas] syntax for set

Raymond Hettinger raymond.hettinger at gmail.com
Mon Nov 22 19:40:21 CET 2010

> I'd be happy with:
> * {:} for empty dict() (as a collection of key-value *pairs*)
> * {.} for empty set() (as a similar collection of *single* elements)
> And {} for empty dict() as well -- to keep compatibility (maybe to be
> deprecated later).

I'm curious why you guys think you *need* an empty set literal.
The current spelling using set() and frozenset() is unambiguous.
So what's the point of trying to shoehorn-in a new literal?

AFAICT, this discussion has been solely motivated by
a shallow itch, "dicts have one, so sets have to have one too".

If there were a clean, beautiful, obvious correct answer,
it would have already been done.   Since there isn't,
we have to ask, who cares?


More information about the Python-ideas mailing list