[Python-Dev] PEP 572: Assignment Expressions

Guido van Rossum guido at python.org
Fri Apr 20 14:55:22 EDT 2018


Christoph's interpretation is correct. I don't rule that out. I also
separately proposed := as something that more people could get behind,
though perhaps it's all moot, and perhaps the PEP would gain clarity if it
went back to proposing "=". (Mostly kidding.)

On Fri, Apr 20, 2018 at 11:47 AM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 04/20/2018 11:31 AM, Christoph Groth wrote:
>
>> Ethan Furman wrote:
>>
>>> On 04/20/2018 11:15 AM, Christoph Groth wrote:
>>>
>>
> OK, but then how about introducing assignment expressions with the "="
>>>> operator but *requiring* extra parens (similar to how modern C
>>>> compilers warn about assignment expressions without parens), e.g.
>>>>
>>>
>>> Using a single "=" for assignment expressions isn't going to happen.
>>> Period.
>>>
>>
>> Huh, I didn't want to irritate anyone!
>>
>
> No worries.  It's just not going to happen.  ;)
>
>
> Guido wrote [1] on python-ideas:
>>
>> I also think it's fair to at least reconsider adding inline
>>> assignment, with the "traditional" semantics (possibly with mandatory
>>> parentheses).  This would be easier to learn and understand for people
>>> who are familiar with it from other languages (C++, Java, JavaScript).
>>>
>>
>> I interpreted this in the way that he at least doesn't rule out "= with
>> parens" completely.  Perhaps he meant ":= with parens", but that would
>> seem redundant.
>>
>
> Ah.  I believe he was referring to not having a statement-local binding,
> but a normal binding instead (so either local or global depending on where
> the expression occurred).
>
> --
> ~Ethan~
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%
> 40python.org
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180420/39126a9f/attachment-0001.html>


More information about the Python-Dev mailing list