[Python-ideas] syntax for set

Jan Kaliszewski zuo at chopin.edu.pl
Mon Nov 22 11:16:41 CET 2010

Terry Reedy dixit (2010-11-15, 13:45):

> The *only* glitch is the lack of an empty set notation. The idea of
> dict() == {:}; set()=={};
> which would be the obvious choice if starting fresh,
> was considered but rejected by Guido as too disruptive
> and introducing another barrier between Python 2 and 3.

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).


More information about the Python-ideas mailing list