[docs] [issue17546] Document the circumstances where the locals() dict gets updated

Eric Snow report at bugs.python.org
Thu Mar 28 23:51:37 CET 2013

Eric Snow added the comment:

> Changing the type of the locals() return isn't the right way to solve
> this problem.  Better docs is the way to do it.  If someone is calling
> locals(), they should read the docs.  Examining the type of values is
> discouraged in Python, we shouldn't expect people to discover
> nonintuitive behavior because the type has been artificially changed
> to "livedict".


Issue #7083 was created to promote a semantic change (ultimately) and it was rejected in deference to a doc change.  That's part of why this ticket was changed to focus on documentation.

My only concern is that locals() has some pretty heavy implementation specifics, so any doc change needs to respect that (or be part of an effort to tighten the spec for locals()).


Python tracker <report at bugs.python.org>

More information about the docs mailing list