[Python-Dev] Object customization (was: Arbitrary attributes on funcs and methods)

Greg Stein gstein@lyra.org
Fri, 14 Apr 2000 14:45:51 -0700 (PDT)


On Fri, 14 Apr 2000, Mark Hammond wrote:
> > I think that we get 95% of the benefit without any of the
> > "dangers"
> > (though I don't agree with the arguments against) if we allow the
> > attachment of properties only at compile time and
> > disallow mutation of
> > them at runtime.
> 
> AFAIK, this would be a pretty serious change.  The compiler just
> generates (basically)PyObject_SetAttr() calls.  There is no way in
> the current runtime to differentiate between "compile time" and
> "runtime" attribute references...  If this was done, it would simply
> be ugly hacks to support what can only be described as unpythonic in
> the first place!
> 
> [Unless of course Im missing something...]

You aren't at all! Paul hit his head, or he is assuming some additional
work to allow the compiler to know more. I agree with you: compilation in
Python is just code execution; there is no way Python can disallow runtime
changes.

(from a later note, it appears he is referring to introducing "decl",
 which I don't think is on the table for 1.6)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/