Another benefit of given compared with := that I just thought of is this.
Suppose you have a generator like

(expression(f(x), y, z)
 for x in xs
 for y in ys(x)
 for z in zs(y))

With given notation you can optimize:

(expression(f_x, y, z)
 for x in xs
 given f_x = f(x)
 for y in ys(x)
 for z in zs(y))

whereas with :=, you can't.

Best,

Neil

On Sat, May 12, 2018 at 10:56 PM David Mertz <[email protected]> wrote:

> Are votes cast in Edwin Hewitt's Hyperreals? I had thought python-ideas
> voted in the domain R rather than *R. :-)
>
> On Sat, May 12, 2018, 5:20 PM Stephen J. Turnbull <
> [email protected]> wrote:
>
>> David Mertz writes:
>>
>>  > Only the BDFL has a vote with non-zero weight.
>>
>> "Infinitesimal" != "zero".
>>
>> Pedantically yours,
>>
>> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python-ideas/CFuqwmE8s-E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
> _______________________________________________
> Python-ideas mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "python-ideas" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/python-ideas/CFuqwmE8s-E/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to