Apparently the PEP authors decided to punt on what they call "algebraic matching" of repeated names. IMNSHO, if this PEP isn't doing algebraic matching then it's really far from clear what it's for, ...
The creators of the Python language are mulling a new proposal, PEP 622, that would finally bring a pattern matching statement syntax to Python. The new pattern matching statements would give Python ...
import matching # ... if m := matching.match(p, (matching.capture('x'), matching.capture('x')): print("Diagonal at %d" % (m.x,)) elif m := matching.match(p, (0 ...