On 7/11/2020 7:54 PM, Greg Ewing wrote:
I can see that being a reasonable choice if you're using 8-space indents, but I don't see that done much in Python.
Also, directly translating this into Python leads to something that looks like a mistake:
match x: case 1: ... case 2: ...
and as has been pointed out, the alternative of putting x on the next line is unprecedented in Python.
If the 2 levels of indenting are really offensive, surely we could teach editors, black, ourselves, etc. to indent the match statement as: match pt: case (x, y): # <-- indent by two spaces return Point3d(x, y, 0) # <-- indent by 2 more spaces, for a total of 4 if x: return x # <-- normally indent by 4 spaces I used to do something similar with C switch statements. I guess you couldn't use this trick if you were using tabs. Another reason to not use them! Eric