At 9:18 PM -0500 1/14/03, Christopher Armstrong wrote:
On Tue, Jan 14, 2003 at 12:38:35PM -0800, Jonathan Sillito wrote:
 > -----Original Message-----
 > From: Dan Sugalski [mailto:[EMAIL PROTECTED]]

 > A property is a runtime assignable name/value pair that you stick on
 > a variable or value. An attribute is a named variable that all
 > objects of a particular class have.
 >
 > Properties can come and go at runtime, but attributes are fixed. (I
 > think you could also consider attributes "instance variables", but
 > I'm a bit OO fuzzy so I'm not sure that's entirely right)

 Ok, in the case of python or ruby, instance variables are not fixed and they
 are not declared as part of the class. I suppose this can be handled by
 giving such classes one hash attribute for storing these instance variables.
Yeah, that would be similar to how Python works now anyway; all
instance attributes are stored in a dict which is itself accessible as
an attribute on an instance: '__dict__'. Oh, except for the new
__slots__ feature, which might actually find a use with the
fixed-attribute-system that Dan has proposed.
I'm pretty sure (though not 100% sure) that the non-slot attribute stuff in python would actually correspond to variable properties, rather than attributes, but I may be incorrect here. Are the current python instance attributes both:

*) defined per object rather than per class
*) Essentially global, that is not hidden from parent classes or anything. (Basically one big pool 'o things attached to the object)
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk

Reply via email to