Author techtonik
Recipients georg.brandl, gvanrossum, nedbat, pitrou, techtonik, terry.reedy
Date 2012-12-26.00:52:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm 3rd to vote for reopening this issue to clarify documentation or to fix (read below).

== Why it is important to fix
1. First personal user story. Until I saw the I couldn't figure out what all locals() definitions are talking about. Dictionary, that is a copy, but the copy is sporadically updated when nobody is using in background. It is a weird dictionary with inconsistent behavior placed at a rather critical part of the language.

2. Second personal story. I probably run into the same bug in issue16781. Probably, because I still don't understand what really happens. It is only a suspicion, and it is bad because with my experience I'm supposed to know what happens, but I never had the time to dig deeper until now.

3. locals() is referenced in exec/execfile() docs for the explanation of arguments. Magic of locals() multiplied by exec.execfile() gives a next level of headache when you need to resolve this. Add settrace() to the formula to awake a hater in you.

exec/execfile() are used in Python-based scripting tools (such as SCons), in trace scripts and when Python is embedded as a scripting language. Coding on this level should be easy to make more interesting tools to appear.

== Fix Idea 
1. Is it possible to rename locals() to _locals(), and leave user visible API function local() for an object that updates itself every time it is accessed?
Date User Action Args
2012-12-26 00:52:47techtoniksetrecipients: + techtonik, gvanrossum, georg.brandl, terry.reedy, pitrou, nedbat
2012-12-26 00:52:47techtoniksetmessageid: <>
2012-12-26 00:52:47techtoniklinkissue7083 messages
2012-12-26 00:52:45techtonikcreate