On Sat, 11 Jul 2020 at 14:39, Ethan Furman <[email protected]> wrote:
>
> On 07/11/2020 04:20 AM, Paul Sokolovsky wrote:
>
> > Actually, the whole argument in PEP 622 regarding "else:", that its
> > placement is ambiguous sounds like a rather artificial write-off.
> > Individual "case"'s are aligned together, but suddenly, it's unclear
> > how to align the default case, introduced by "else"? Who in good faith
> > would align it with "match"?
>
> I would.
How do you feel about the fact that
match EXPR:
case 1:
print("One")
case _:
print("default")
and
match EXPR:
case 1:
print("One")
else:
print("default")
are semantically completely identical, but syntactically must be
indented differently? That for me is probably the most compelling
reason for preferring to indent else to the same level as case¹. I'm
curious to understand how people who prefer aligning else with match
view this. (Not least, because I anticipate some "interesting" code
style flamewars over this ;-))
Paul
¹ When I say "most compelling" I mean "inclines me to have a mild
preference" :-) In reality I mostly don't care, and I'll probably just
use "case _" in any projects I work on and ignore the existence of
"else" altogether.
_______________________________________________
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/ZM6CQQ4W2Q3S3NKFHPPWZHJPK3FNHJJW/
Code of Conduct: http://python.org/psf/codeofconduct/