On 06/24/2020 11:08 AM, Guido van Rossum wrote:
Nearly every other language whose pattern matching syntax we've examined uses _
as the wildcard.
The authors don't feel very strongly about whether to use `else:` or `case _:`.
The latter would be possible even if we added an explicit `else` clause, and we
like TOOWTDI. But it's clear that a lot of people *expect* to see `else`, and
maybe seeing `case _:` is not the best introduction to wildcards for people who
haven't seen a match statement before.
It seems to me that TOOWTDI is already violated. I don't think most people
will see a significant different between:
case _:
and
case a_name:
As far as alignment, I think "else" should align with "match" -- it more
strongly signifies that no match was found - at least to me ;) .
--
~Ethan~
_______________________________________________
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/3FXWX3X4MKYCUUHLCHF4SEXJYND5UHVU/
Code of Conduct: http://python.org/psf/codeofconduct/