[Python-Dev] PEP280 and my experiment

Phillip J. Eby pje@telecommunity.com
Sat, 14 Jun 2003 08:46:29 -0400


At 03:15 AM 6/14/03 +0200, Samuele Pedroni wrote:

>this is probably far from ideal for closures, OTOH with the right 
>infrastructure it should be possible to store created caches e.g. in code 
>objects and so reuse them.

Perhaps I'm misunderstanding, but wouldn't code objects be a bad place to 
put a cache, since the same code object can be used for more than one 
function object, each with different globals?  This would be problematic 
for code that uses 'exec code in dict' to load scripting code into a 
restricted execution space, for example.