Congrats to Chris for breaking his PEP curse

Chris Angelico rosuav at gmail.com
Wed Jul 4 06:09:20 EDT 2018


On Wed, Jul 4, 2018 at 7:31 PM, Gregory Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Ian Kelly wrote:
>>
>> I can't now write all my statements as:
>>
>> f(f := lambda f: do_something())
>
>
> No, but you should be able to do
>
>    (f := lambda f: do_something())(f)
>
> although since you're binding f in a scope that can be seen
> by the lambda, there's probably not much point in passing it,
> you could just do
>
>    (f := lambda: do_something())()

Not inside a loop, no.

ChrisA



More information about the Python-list mailing list