[Zope-dev] Re: Replaceable Property question

Chris Withers chrisw@nipltd.com
Mon, 07 Aug 2000 18:55:21 +0100


Shane Hathaway wrote:
> > Will it re-appear when the replacement is deleted?
> >
> > That could be confusing...
> 
> No, and I think it's really not confusing, since it's quite a strange
> and rare thing to set __replaceable__=ObjectManager.REPLACEABLE on a
> normal instance.  :-/

Very true :-)

> Think of it more like Python instances vs. classes.  Setting
> __replaceable__=REPLACEABLE on a ZClass method is like setting a class
> attribute in Python, then overriding it in an instance is like setting
> an instance attribute.  If you set __replaceable__=REPLACEABLE on an
> instance attribute, then replace it, it's like setting "foo.a = bar"
> then "foo.a = boo".  The reference to "bar" disappears without any
> implicit recovery.

Hurm, that is a shame...
What happens if you override a method (say Squishdot.render) and then
delete your overriding method?
Does it depend on whether you're talking about python products or
ZClasses?

cheers,

Chris