what does := means simply?

Chris Angelico rosuav at gmail.com
Thu May 17 10:03:51 EDT 2018


On Thu, May 17, 2018 at 9:58 PM, bartc <bc at freeuk.com> wrote:
> On 17/05/2018 04:54, Steven D'Aprano wrote:
>>
>> On Thu, 17 May 2018 05:33:38 +0400, Abdur-Rahmaan Janhangeer wrote:
>>
>>> what does := proposes to do?
>
>
>> A simple example (not necessarily a GOOD example, but a SIMPLE one):
>>
>> print(x := 100, x+1, x*2, x**3)
>
>
> It's also not a good example because it assumes left-to-right evaluation
> order of the arguments. Even if Python guarantees that, it might be a
> problem if the code is ever ported anywhere else.
>

Python DOES guarantee it, and nobody cares about your personal toy
language other than you. :)

ChrisA



More information about the Python-list mailing list