variable scope in try ... EXCEPT block.

Chris Angelico rosuav at gmail.com
Thu Jul 12 13:00:11 EDT 2018


On Thu, Jul 12, 2018 at 11:23 PM, Ed Kellett <e+python-list at kellett.im> wrote:
> Could we fix:
>
>   for x in something:
>     blah(lambda a: a + x)
>
> while we're at it?

What do you mean by "fix"? Make the 'x' bind eagerly? That would break
basically every other use of closures.

ChrisA


More information about the Python-list mailing list