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

Bruce Leban bruce at leapyear.org
Wed Jun 17 02:38:16 CEST 2009


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.

--- Bruce


On Tue, Jun 16, 2009 at 5:25 PM, Ben Finney
<ben+python at benfinney.id.au<ben%2Bpython at benfinney.id.au>
> wrote:

> Guido van Rossum <guido at python.org> writes:
>
> > On Tue, Jun 16, 2009 at 11:24 AM, Terry Reedy<tjreedy at udel.edu> wrote:
> > > OrderedDict({'a':1', 'b':'2', 'c':'3'}]
> > >
> > >
> > >> How about ['a':'1', 'b':'2', 'c':'3']?
> >
> > -100.
>
> (Hey! I though the valid range of votes was -1 through +1, I didn't know
> we were giving the BDFL more than one vote! :-)
>
> Can you summarise what you dislike about the above syntax suggestion for
> ordered dict literal?
>
> --
>  \      “If the desire to kill and the opportunity to kill came always |
>  `\      together, who would escape hanging?” —Mark Twain, _Following |
> _o__)                                                     the Equator_ |
> Ben Finney
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090616/79bfabd3/attachment.html>


More information about the Python-ideas mailing list