ThreadLocal state in PythonInterpreter

Jeff Allen <[email protected]>
Newsgroups gmane.comp.lang.jython.devel
Message-ID <[email protected]>
https://hg.python.org/jython/rev/c392bcd63a50 introduced a thread local 
to PythonInterpreter that holds the locals used when executing code. As 
far as I can tell, this is only engaged when creating a JSR-223 script 
engine, but then unconditionally affects the script engine.

I understand why I might want multple engines with their own namespace, 
but why would I want any single engine in which the local variables 
automagically change to a different dictionary according to which 
(platform) thread looks at them?

In the circumstances where I might want do this, why do we also suppress 
the creation of a __main__ module to represent the current namespace? 
(https://hg.python.org/jython/rev/c392bcd63a50#l3.107) This difference 
from a normal interpreter seems to be an annoyance for some users 
(https://bugs.jython.org/issue2846).

It all looks deliberate, and is quite an old change, but what on earth 
is the motivation?

Jeff

-- 
Jeff Allen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.