Local variable in a closure

Ian Kelly ian.g.kelly at gmail.com
Sun Aug 18 06:40:10 EDT 2013


f is nonlocal to times(), local to multiplier().  As the docs for the
locals() function say, "Free variables are returned by locals() when
it is called in function blocks, but not in class blocks."

On Sun, Aug 18, 2013 at 3:41 AM,  <w.w.milner at googlemail.com> wrote:
> Is f local or not?
> http://pastebin.com/AKDJrbDs
> --
> http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list