That's a strawman argument. I am done arguing about this.

On Fri, Jul 31, 2020 at 7:47 PM Nick Coghlan <ncoghlan@gmail.com> wrote:


On Sat., 1 Aug. 2020, 10:55 am Guido van Rossum, <guido@python.org> wrote:
Trust me, the PEP authors are well aware. If we hadn't been from the outset, a hundred different proposals to "deal" with this would have. And many of those proposals actually made it into the list of rejected ideas. Moreover, we rewrote a huge portion of the PEP from scratch as a result  (everything from Abstract up to the entire Rationale and Goals section).

Apart from your insistence that we "acknowledge" an "inconsistency", your counter-proposal is not so different from the others.

Right, there are several ways the PEP could be adjusted so that assignment target syntax and pattern matching syntax had consistent semantics whenever they share syntax, just as other name binding syntaxes are already strict subsets of the full assignment target syntax. I personally like "Use '?' as an explicit constraint expression prefix", but it's far from being the only possibility.

But if we don't even agree that common syntax in a name binding context should either always mean the same thing, or else be a syntax error, then we're not going to agree that there's a problem to be solved in the first place.

Let's agree to disagree on the best syntax for patterns

I think our disagreement is more fundamental than that, as I believe there should be a common metasyntax for imperative name binding (i.e. everything except function parameters) that all actual name binding contexts allow a subset of, while the PEP authors feel it's OK to treat pattern matching as a completely new design entity that only incidentally shares some common syntax with assignment targets.

Prior to PEP 622, the apparent design constraint that I had inferred was implicitly met by the fact that all the imperative name binding operations accept a subset of the full assignment target syntax, so it's never actually come up before whether this is a real design goal for the language, or just a quirk of history.

PEP 622 is forcing that question to be answered explicitly, as accepting it in its current form would mean telling me, and everyone else that had inferred a similar design concept, that we need to adjust our thinking.

I'd obviously prefer it if the PEP chose a different syntax that avoided the semantic conflict with assignment for dotted names, but in the absence of that, I'd settle for the explicit statement that we're wrong and inferred a design principle that never actually existed.

Cheers,
Nick.







--
--Guido van Rossum (python.org/~guido)
Pronouns: he/him (why is my pronoun here?)