On Sat, Apr 26, 2014 at 11:03 PM, Philipp A. <flying-sheep@web.de> wrote:
> in python, the most similar thing is something like this:
>
> 'key1': lambda: eggs += lay_eggs(), #branch 1Except that lambda doesn't create a code block, it creates a nested
function. This example won't work, and nor will anything else that
needs to mutate locals; you'd have to declare an out-of-line function
(as with branch_2_3) to be able to assign to 'nonlocal eggs'.
ChrisA
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/