[Python-ideas] Possible method of distinguishing between set-literals, dict-literals, and odict-literals

MRAB python at mrabarnett.plus.com
Wed Jun 17 03:28:03 CEST 2009

Bruce Leban wrote:
> Personally, if I had a time machine I would pick a syntax like
>         set{...}
> over
>         set([...])
> but I don't have a time machine and even if I did I don't think I'd use 
> it for that. The difference is that the former is special syntax, while 
> the latter isn't. No matter what I do to the the varible r, r"string" is 
> still a string, while set([...]) can be perverted.
> However, given what we've got I can't really say that ([ instead of { is 
> that big a deal.
You can have any iterable between the (...); it's just that the iterable
happens to be a list literal.

More information about the Python-ideas mailing list