[Python-Dev] Re: PEP 622: Structural Pattern Matching

2020年6月24日 13:10:11 -0700

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 -- [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/3FXWX3X4MKYCUUHLCHF4SEXJYND5UHVU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to