On Wed, 12 Aug 2015 21:05:50 +0200, Andrea Griffini wrote:
> Is it intended that closures created in exec statement/function cannot see
> locals if the exec was provided a locals dictionary?
>
> This code gives an error ("foo" is not found during lambda execution):
>
> exec("def foo(x): retu
Is it intended that closures created in exec statement/function cannot see
locals if the exec was provided a locals dictionary?
This code gives an error ("foo" is not found during lambda execution):
exec("def foo(x): return x\n\n(lambda x:foo(x))(0)", globals(), {})
while executes normally w