On 04/10/2018 10:32 PM, Chris Angelico wrote:
Title: Assignment Expressions
Thank you, Chris, for doing all this!
---
Personally, I'm likely to only use this feature in `if` and `while` statements; if the syntax was easier to read inside
longer expressions then I might use this elsewhere -- but as has been noted by others, the on-the-spot assignment
creates asymmetries that further clutter the overall expression.
As Paul noted, I don't think parenthesis should be mandatory if the parser
itself does not require them.
For myself, I prefer the EXPR as NAME variant for two reasons:
- puts the calculation first, which is what we are used to seeing in if/while
statements; and
- matches already existing expression-level assignments (context managers,
try/except blocks)
+0.5 from me.
--
~Ethan~
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/