[Python-ideas] Spelling of Assignment Expressions PEP 572 (was post #4)
Chris Angelico
rosuav at gmail.com
Fri Apr 13 15:33:57 EDT 2018
On Fri, Apr 13, 2018 at 11:30 PM, Peter O'Connor
<peter.ed.oconnor at gmail.com> wrote:
> Well this may be crazy sounding, but we could allow left or right assignment
> with
>
> name := expr
> expr =: name
>
> Although it would seem to violate the "only one obvious way" maxim, at least
> it avoids this overloaded meaning with the "as" of "except" and "with"
>
Hah. It took me multiple readings to even notice the change in the
operator there, so I think this would cause a lot of confusion. (Don't
forget, by the way, that an expression can be a simple name, and an
assignment target can be more complicated than a single name, so it
won't always be obvious on that basis.) It probably wouldn't
*technically* conflict with anything, but it would get extremely
confusing!
ChrisA
More information about the Python-ideas
mailing list