On Sat, Jul 11, 2020 at 2:45 PM Ethan Furman <et...@stoneleaf.us> wrote:

> On 07/11/2020 10:29 AM, Jim J. Jewett wrote:
> > To me, "else:" has a slightly different meaning than "case _:"
> >
> >          case _:  essentially a default, ensuring that the match logic
> is complete.
> >
> >      else:  OK, the subject of this match failed, here is our fallback
> logic.
> >
> > Whether this distinction is important enough to express in code is
> another question, as is whether or not anyone but me would follow this
> "obvious" convention.  So I'm not convinced  the difference justifies the
> existence a second syntax.  But I'm also not sure it doesn't, particularly
> if that distinction were given in the PEP and in documentation for the
> match statement.
>
> This is exactly how I would use it.
>

Hm... Just the fact that people have been arguing both sides so
convincingly makes me worry that something bigger is amiss. I think we're
either better off without `else` (since the indentation of `case _` cannot
be disputed :-), or we have to revisit the reasons for indenting `case`
relative to `match`. As MRAB said, it's a case of picking the least
inelegant one.

Let me add that the parser can easily deal with whatever we pick -- this is
purely about human factors.

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
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/FR46LF57QUYTOIJ3HKOYSJXVIK6XOTZC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to