[Python-ideas] Fwd: quantifications, and tuple patterns
Ethan Furman
ethan at stoneleaf.us
Tue Jan 17 06:39:18 CET 2012
Paul Moore wrote:
> On 16 January 2012 14:47, Devin Jeanpierre <jeanpierreda at gmail.com> wrote:
>> You can always add a full-on assignment-as-expression, if you're
>> concerned about that.
>>
>> if (m := pat.search(data)) is not None:
>>
>> Also, the keyword doesn't have to be "if". I've always read the bar as
>> "such that" or "where".
>
> I suggested that a while back in this thread (in the form of any(var
> := val for val in itr if pred)). It didn't get much traction
In the matter of := being used for assignment-as-expression... +1!
~Ethan~
More information about the Python-ideas
mailing list