On 25/06/20 8:49 am, Tim Peters wrote:
Spell it, e.g., "or", and then I wonder "what does short-circuiting have to do with it?".
Well, it does short-circuit -- if one alternative matches, it doesn't bother with any subsequent ones. Which could be considered an argument for using "or" instead of "|".
Names in destructuring constructs are overwhelmingly intended as lvalues,
That assumes the match statement is going to be used in a predominantly destructuring way, which I don't think is a foregone conclusion.
In a destructuring assignment, *all* the names on the LHS are assignment targets, and *none* on the RHS are, which makes it easy to see what is being assigned to.
But with these new pattern expressions, either can appear anywhere in any mixture. While trying to grok the PEP, I was really struggling to look at something like
Point(x = a)
and decide whether x or a or neither was being assigned to. Which makes me think there should be something *really* clear and unambiguous to indicate when assignment is happening.