Fredrik Johansson wrote:
On Nov 9, 2007 3:39 PM, Boris Borcic email@example.com wrote:
Title says it all. Got used to += et al. My mind often expects augmented assignment syntax to exist uniformly for whatever transform.
If I am not mistaken, python syntax doesn't permit augmented assignment operators to sit between parens so that )= wouldn't risk confusing quick machine- or eye-scans to match parens.
Would the statement
( x )= f
represent the ordinary assignment x=f or would it become a syntax error?
Ah, and what about
- more likely to already exist in the wild, isn't it ?
Well, if ')=' was an augmented assignment operator, I'd say
should parse as a destructuring assignment as it already does while
should become a syntax error. I admit it's debatable, of course. I think a case could be made in terms of lookahead tokens in favor of that solution (all other things equal).