Message282236
In addition, also if here "function blocks" means nested function, the sentence "Free variables are returned by locals() when it is called in function blocks" I think is wrong. It is true only in case of free variables belonging to the local enclosing scope. For instance, in the following case ``x`` is free in ``moo()``, but it is not in ``locals()``::
>>> x = 10
>>> def foo():
... def moo():
... print(x)
... print(locals())
... return moo
...
>>> moo = foo()
>>> moo()
10
{}
I attach a patch with a new description and an example.
PS. Is the rst rendered by Sphinx? In that case, why we are not using the doctest Sphinx extension to test the code examples? |
|
Date |
User |
Action |
Args |
2016-12-02 11:32:02 | marco.buttu | set | recipients:
+ marco.buttu, docs@python |
2016-12-02 11:32:02 | marco.buttu | set | messageid: <1480678322.22.0.562226953352.issue28853@psf.upfronthosting.co.za> |
2016-12-02 11:32:02 | marco.buttu | link | issue28853 messages |
2016-12-02 11:32:02 | marco.buttu | create | |
|