[Python-Dev] assignment expressions: an alternative proposal

Ethan Furman ethan at stoneleaf.us
Tue Apr 24 11:57:02 EDT 2018


On 04/24/2018 08:35 AM, Yury Selivanov wrote:

> Yes, it would force users to come up with better names *iff* they want
> to use this new sugar:
>
>    if (first_target = get_first_candidate()) ...
>    elif (second_target = get_second_candidate()) ...

And then the common code below that only cares about a target being found now has to do a

   item = first_target or second_target or ...

I don't see that as an improvement.

--
~Ethan~



More information about the Python-Dev mailing list