(original) (raw)
This is just some syntax sugar:
Since set literals will change to for example
{1,2,3} from set(\[1,2,3\]) and set comprehensions will be specified inside
{} I feel that {} will be more naturally associated with sets than dicts
(or at least as much).
What if the empty set literal is changed to {} and
an empty dict literal changed to {:}. Performing the conversion automatically
wouldn't be so complex and also un-ambiguous. The hardest thing to change would
be the mentality then.
i.e:
{} ::= set(\[\])
{1,2,3} ::= set(\[1,2,3\])
{x for x in y} ::= set(x for x in y)
{:} ::= dict()
{a:b, h:j} is a dict since it contains
colons.
I hope this isn't a stupid suggestion (I'm new
here).
-Neville