ok -- this has to be a stupid question that I should have RTFM somewhere -- 
but I couldn't find the FM for the life of me. Given the following code, I 
can see why access to self.thing fails in Inner::__setattr__, but the 
question is how do I do that -- can I not use __setattr__ and have to use a 
setAttr that is accessed via O.I.setAttr('help','me rhonda') ?


import ExtensionClass, Acquisition

class Outer(ExtensionClass.Base):
        thing = ('help','donthelp')

class Inner(Acquisition.Implicit):
        def __setattr__(self,name,value):
                if name in self.thing:
                        self.__dict__['name'] = value
                        print "Bad attribute"
O = Outer()
I = Inner()
O.I = I
print O.I.thing  # is ok  --> gives ('help','donthelp')
O.I.help = 'me rhonda' # AttributeError: thing

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to