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 terry.reedy
Date 2009-09-16.22:54:39
SpamBayes Score 2.9599758e-09
Marked as misclassified No
Message-id <1253141682.71.0.279725067044.issue6925@psf.upfronthosting.co.za>
In-reply-to
Content
Doc for locals(): after correctly stating
"Update and return a dictionary representing the current local symbol table.

Note
The contents of this dictionary should not be modified; changes may not
affect the values of local variables used by the interpreter."

current doc goes on to say
"Free variables are returned by locals() when it is called in a function
block. Modifications of free variables may not affect the values used by
the interpreter. Free variables are not returned in class blocks."

As best I can understand this, it is wrong and should be removed. Free
variables within a function block are global/nonlocal names and by my
experimentation with 3.1, (including lambda expressions) are NOT
returned by locals(). If it means something else, it needs a rewrite.

The doc for var() starts "Without arguments, return a dictionary
corresponding to the current local symbol table." I suggest augmenting
this with 'update and ' (to match locals doc) and '(same as locals())'
to make that fact clear (as it is with help(vars)), even though removing
the 'Free variables' stuff will help the latter clearer also. The result
would be

Without arguments, update and return a dictionary corresponding to the
current local symbol table (same as locals()).
History
Date User Action Args
2009-09-16 22:54:42terry.reedysetrecipients: + terry.reedy
2009-09-16 22:54:42terry.reedysetmessageid: <1253141682.71.0.279725067044.issue6925@psf.upfronthosting.co.za>
2009-09-16 22:54:40terry.reedylinkissue6925 messages
2009-09-16 22:54:40terry.reedycreate