[Python-3000] Set literal

Ron Adam rrr at ronadam.com
Sat Jan 26 01:58:33 CET 2008



Raymond Hettinger wrote:

> P.S.  A small side-benefit is it may put an end for interminable requests for a {:} or {/} notation for empty sets.  There's not much need for a literal for a empty frozenset (use "not s" instead).


How about also removing the {} as an empty dictionary?  Then both
dictionary and set literals will require at least one item to be valid.  No 
  confusion, and {} is not allowed because it's ambiguous (to users) as to 
weather it's a set or dictionary.



Would set({a, b, c}) be valid?

If so, should the repr for a set be set({a, b, c}) instead of
set([a, b, c])?


Ron






More information about the Python-3000 mailing list