
On 2020-07-16 17:37, Steve Holden wrote:
While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../finally/else, and nobody seems to think that the excepts should be indented. Or the finally. And naturally the match/else case are at the same indentation level, just as for/else, while/else and try/finally. So why, exactly, should case be indented?
My apologies for being a Bear of Very Little Brain.
[snip] For all other statement structures (if, while, try, etc.), the first line ends with a colon and the second line is indented (and is a statement). Therefore the cases should be indented. However, for all other statement structures (if, while, try, etc.), the other parts of the structure itself (elif, else, except, etc.) aren't indented. Therefore the cases shouldn't be indented. Either way, it's inelegant.