On 25/06/2020 00:54, Tim Peters wrote:
[Ethan Furman <et...@stoneleaf.us>]
"case _:" is easy to miss -- I missed it several times reading through the PEP.
As I said, I don't care about "shallow first impressions". I care
about how a thing hangs together _after_ climbing its learning curve -
which in this case is about a nanometer tall ;-)
You're not seriously going to maintain that you're struggling to grasp
the meaning of "case _:" now, right?
I'm seriously going to maintain that I will forget the meaning of "case
_:" quickly and regularly, just as I quickly and regularly forget to use
"|" instead of "+" for set union. More accurately, I will quickly and
regularly forget that in this one place, "_" is special.
while _ does not bind to anything, but of what practical importance is that?) .
One obvious way to do it is of major practical importance.
Yeah, but the "obvious" is being contended, and saying "but it's
obvious" doesn't really constitute an argument to those of us for whom
it isn't obvious.
".NAME" grated at first, but extends the idea that dotted names are
always constant value patterns to "if and only if". So it has mnemonic
value.
How do you get from "." to "iff" ?
See reply to Glenn. Can you give an example of a dotted name that is
not a constant value pattern? An example of a non-dotted name that is?
If you can't do either (and I cannot)), then that's simply what "if
case long.chain.of.attributes:
or more likely
case (foo.x, foo.y)
for the first. For the second, it's a no-brainer that you can't have a
non-dotted name as a constant value pattern, since the current constant
value pattern mandates a leading dot.
--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/AW53OVSLMPMFH4PSMDU35SQTCUAVVT2O/
Code of Conduct: http://python.org/psf/codeofconduct/