[Zope3-dev] Re: keeping attributes abstract

Philipp von Weitershausen philipp at weitershausen.de
Thu Mar 9 19:20:16 EST 2006


Stephan Richter wrote:
>>class Foo(Persistent):
>>    implements(IFooB)
>>
>>   def setBar(self, bar):
>>        ....
>>
>>   def getBar(self):
>>        ....
>>
>>   bar = property(getBar, setBar)
> 
> 
> The disadvantage here, of course, is that the {g,s}etBar methods hang around 
> in the class for no reason. Benji's example avoided this.

Benji's example is also beyond any magic of most of the people.
*Especially* when you're just new to Python.

When I first saw constructs like this (using @apply), I was immediately
repelled and came up with this:
http://codespeak.net/svn/user/philikon/rwproperty/. There I also explain
the problems I see with the @apply approach in more detail.

Philipp


More information about the Zope3-dev mailing list