[docs] [issue17546] Document the circumstances where the locals() dict get updated
report at bugs.python.org
Thu Jan 15 15:25:02 CET 2015
Martin Panter added the comment:
What about instead of
Whether changes to one are reflected in the other after the call returns is undefined; additionally, the dictionary may change unpredictably after the call, and how it does is implementation-specific.
substitue this wording:
Whether changes to one are reflected in the other after the call returns, and when such updates occur, is undefined and implementation-specific.
The old wording seems under-specified. It would allow a function call, garbage collection, etc, to clobber the dictionary, say overwriting with another function’s locals(), before you get a chance to work with the dictionary.
Python tracker <report at bugs.python.org>
More information about the docs