On Wed, Jun 24, 2020 at 3:15 PM Ethan Furman firstname.lastname@example.org wrote:
I too thought "why not else:?" at first. But "case _:" covers it in the one obvious way after grasping how general wildcard matches are.
"case _:" is easy to miss -- I missed it several times reading through the PEP.
Introducing "else:" too would be adding a wart (redundancy) just to stop shallow-first-impression whining.
Huh. I would consider "case _:" to be the wart, especially since "case default:" or "case anything:" or "case i_dont_care:" all do basically the same thing (although they bind to the given name, while _ does not bind to anything, but of what practical importance is that?) .
There's always making everyone equally annoyed, and allowing 'case else:' (not a very serious suggestion, though it does have a certain sort of symmetry).