This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients docs@python, martin.panter, rhettinger, terry.reedy
Date 2016-04-01.18:24:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459535099.79.0.193181068981.issue26683@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-04-01 18:24:59terry.reedysetrecipients: + terry.reedy, rhettinger, docs@python, martin.panter
2016-04-01 18:24:59terry.reedysetmessageid: <1459535099.79.0.193181068981.issue26683@psf.upfronthosting.co.za>
2016-04-01 18:24:59terry.reedylinkissue26683 messages
2016-04-01 18:24:59terry.reedycreate