On 15/06/2026 20:42, Chris Angelico via Python-list wrote:
On Tue, 16 Jun 2026 at 05:41, Rob Cliffe via Python-list
<[email protected]> wrote:
Chris, you say the restriction is not arbitrary.  Well, it seems so to
me.  Why not
a.b := c # as Jon mentioned L[2:4] := M[3:5] L[3] := x (a,b) := (c,d) Of
course these would be part of an expression, not complete lines of code.
This very much reminds me of the rather stringent syntax restrictions
that were initially put on decorators. Eventually these restrictions
were removed.
Please define "arbitrary'. The restriction is extremely simple and
prevents syntactic ambiguities.

Of course, if you want to change this, you're most welcome to try to
convince the SC that they made a mistake.

ChrisA
You know what "arbitrary" means, but let's take it as
    "decided for no good reason".
I have read the PEP and it simply states
    "NAME is an identifier"
and later
    "Single assignment targets other than a single |NAME| are not supported" Nowhere as far as I can see does it offer any justification for this decision.
Nor does it say that this is a restriction for the initial implementation
which might be removed subsequently - which would be sensible
(much the same happened with f-strings).
Unnecessary restrictions reduce the uniformity of the language (one of Python's strengths). People will try something that they expect to work, find it's not allowed, and ask "Why can't I do that?".
Can you give one or more examples of syntactic ambiguities that might arise
(and preferably can't be fixed by adding parentheses) ?
Any such would be a powerful argument that might change my opinion.
Best wishes
Rob Cliffe

--
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to