[Python-Dev] reload() et al. (Re: [Import-sig] Re: Proposal for a modified import mechanism.)

M.-A. Lemburg mal@lemburg.com
Thu, 15 Nov 2001 18:48:55 +0100


Just van Rossum wrote:
> 
> M.-A. Lemburg wrote:
> 
> > > General question: why if func_globals not a writable attribute?
> >
> > Why should it be ? Just think of the security holes this would
> > open.
> 
> Huh? You can change func_globals in place, I don't see how it's more vulnerable
> to replace it with another dict. Assigning to func_code, func_defaults, func_doc
> and func_dict is allowed, I was just wondering if there's a specific reason why
> it's not allowed for func_globals. Am I missing something obvious here?

Hmm, looking at the code it seems that assigning to various function
object attributes has always been allowed. I wonder why... since it 
doesn't have any obvious use except preventing to pretend that 
function objects are immutable (which is what I would have expected).

Nevermind,
-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/