[Python-ideas] Spelling of Assignment Expressions PEP 572 (was post #4)

Nikolaus Rath Nikolaus at rath.org
Sat Apr 14 11:46:24 EDT 2018


On Apr 14 2018, Chris Angelico <rosuav-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> On Fri, Apr 13, 2018 at 11:30 PM, Peter O'Connor
> <peter.ed.oconnor-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> 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.

Well, if putting the expression first is generally considered better,
the reasonable thing to do would be to allow *only* =:.

-Best
Nikolaus
-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-ideas mailing list