[Zope-dev] adding properties to instances v. classes

Dieter Maurer dieter@handshake.de
Thu, 21 Nov 2002 20:11:10 +0100


Jamie Heilman writes:
 > ...
 > I'm wondering if there's any reason why simply adding the properties
 > and instance variables to the instance within __init__ would be a bad
 > thing for properties that you want to declare removable.
The restriction is a precaution against an accidental overriding
of essential infrastructure.

  Think, when someone creates of property with the name
  "manage_main" or "manage_workspace".

  Or when he create a property with the same name as a content
  object. What should happen?

An additional declaration might help, something like
"_addableProperties". Names specified in this sequence
could be allowed as property names unless the instance (itself)
already has an attribute of this name.
Of course, something like this needs to be implemented and is
currently not available.


Dieter