Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52654

Re: Local variable in a closure

References <107941d9-a981-4dd6-8460-336afc16f025@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2013-08-18 04:40 -0600
Subject Re: Local variable in a closure
Newsgroups comp.lang.python
Message-ID <mailman.25.1376822460.23369.python-list@python.org> (permalink)

Show all headers | View raw


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@googlemail.com> wrote:
> Is f local or not?
> http://pastebin.com/AKDJrbDs
> --
> http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Local variable in a closure w.w.milner@googlemail.com - 2013-08-18 02:41 -0700
  Re: Local variable in a closure Chris Angelico <rosuav@gmail.com> - 2013-08-18 11:28 +0100
  Re: Local variable in a closure Ian Kelly <ian.g.kelly@gmail.com> - 2013-08-18 04:40 -0600
  Re: Local variable in a closure Dave Angel <davea@davea.name> - 2013-08-18 10:44 +0000
  Re: Local variable in a closure Terry Reedy <tjreedy@udel.edu> - 2013-08-18 16:42 -0400

csiph-web