Message262753
I requested that we stop (mis)using 'free variable' in the docs years ago. A strong +1 from me.
The 'locals' function what named when 'local' and 'non-global' were synonyms. When non-local, non-global names were added, nonlocals were included with 'locals' as 'non-global'. (This must have been thought to be more useful than adding nonlocals() or excluding them.)
They are, of course, local in some surrounding non-global context. And for most purposes, their entries in locals() should also be treated as read-only. I think the doc should say that function locals() includes the locals of surrounding function contexts, even though they are called 'nonlocal' within the nested function. |
|
Date |
User |
Action |
Args |
2016-04-01 18:24:59 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, docs@python, martin.panter |
2016-04-01 18:24:59 | terry.reedy | set | messageid: <1459535099.79.0.193181068981.issue26683@psf.upfronthosting.co.za> |
2016-04-01 18:24:59 | terry.reedy | link | issue26683 messages |
2016-04-01 18:24:59 | terry.reedy | create | |
|