On Fri, Apr 13, 2018 at 9:17 PM, Steven D'Aprano <st...@pearwood.info> wrote: > On Thu, Apr 12, 2018 at 07:28:28AM +1000, Chris Angelico wrote: > >> Fair enough. Also adding that chained assignment expressions should >> generally be avoided. > > So long as its not a blanket prohibition, I'm good with that. > > Also, something like this: > > spam := 2*(eggs := expression) + 1 > > should not be considered a chained assignment. >
Agreed. Chained assignment is setting the same value to two or more targets, without any further changes or anything: a = b = c = 0 Extremely handy as a statement (quickly setting a bunch of things to zero or None or something), but less useful with expression assignment. Incidentally, I've only just made "x := y := 1" legal tonight (literally during the writing of this post). Previously it needed parentheses, and I just didn't see much priority on fixing something that wasn't all that crucial :) ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/