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

anatoly techtonik report at bugs.python.org
Fri Mar 29 07:08:32 CET 2013


anatoly techtonik added the comment:

Ok. Maybe I proposed the solution too early. I am fine with doc fix, but given the previous experience I have doubts it will happen. Maybe opening a wiki page with a current draft can help:

   http://wiki.python.org/moin/Locals
    or better
   http://piratepad.net/locals

Describing implementation details is necessary, but they should include a recommendation how to work with locals safely and avoid hitting yourself in the foot if you don't want to read about internals. For that I propose "if you are not interested in implementation details, always copy locals() to dict to avoid potential problems with auto-updating behavior. This is also guaranteed to work with other Python implementations." Is that ok?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17546>
_______________________________________


More information about the docs mailing list