On Mon, 4 Jan 2021, 4:34 am Ethan Furman, <[email protected]> wrote:

> On 1/3/21 8:50 AM, Paul Moore wrote:
>
> > Personally, I read it and was horribly confused.
>
> >>          case object{.host as host, .port as port}:
> >>              pass
>
> Leading periods is a big no-go for me, for all the reasons listed in the
> original thread.
>

It gave me pause as well, but the differences I see relative to the
proposed usage in the early iterations of PEP 622 are:

1. This dot isn't semantically significant to the parser, it's just a "this
is an attribute name" hint for the human reader. If you forget it, you get
a syntax error rather than the code meaning something else.
2. It only appears inside instance attribute mappings, not as part of
arbitrary patterns, so the leading dot isn't the only "this is an attribute
reference" hint.
3. It means the same thing as dots do in the rest of Python (indicating
that the following identifier is an attribute name).

Cheers,
Nick.



>
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/KPDHJIU3MNU6ID6SVKGDGYW7AY435QYY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to