I also find the example with :keyword a bit jarring at first glance, so I
propose a double colon to alleviate the problem if we go in that direction.
Compare:

    { :a, "b": x, :c }

    { ::a, "b": x, ::c }

On Fri, Apr 17, 2020 at 10:05 PM Rhodri James <rho...@kynesim.co.uk> wrote:

> On 17/04/2020 19:21, Andrew Barnert via Python-ideas wrote:
> >> On Apr 17, 2020, at 01:58, Steven D'Aprano<st...@pearwood.info>  wrote:
> >>
> >> On Thu, Apr 16, 2020 at 09:21:05PM -0700, Andrew Barnert via
> Python-ideas wrote:
> >>
> >>> But I don’t see why that rules out the “bare colon” form that I and
> >>> someone else apparently both proposed in separate sub threads of this
> >>> thread:
> >>>    { :a, "b": x, :c }
> >>> as shorthand for:
> >>>    { "a": a, "b": x, "c": c }
> >>
> >> I did a double-take reading that, because I visually parsed it as:
> >>
> >>    { :a,
> >>      "b":
> >>      x, :c
> >>      }
> >>
> >> and couldn't work out what was going on.
> >>
> >> After saving this draft, closing the email, then reopening it, I read
> >> the proposed dict the same way. So I don't think it was just a momentary
> >> glitch.
> > I honestly think, as you suggested at the end, that this may be just
> you. You’ve had similar reactions to other syntax that nobody else
> replicated, and I think that’s happening again here.
>
> It's not just Steven.  After dusting my monitor to remove flyspecs, I
> still couldn't find a natural way of reading that example.  I didn't
> visually parse it quite the same, but the excess of punctuation still
> encourage me to completely miss the '"b": x' part being a unit.
>
> --
> Rhodri James *-* Kynesim Ltd
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/7UU4MDSHLYFZ6UEDJBEZU4POL6QGGY45/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/GU23Y7RRBYJL75VCTUJCJZNE2J24MBZJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to