Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-10 Thread Gary Poster
On Mar 9, 2006, at 7:20 PM, Philipp von Weitershausen wrote: http://codespeak.net/svn/user/philikon/rwproperty/ This is nice. I'm going to use it right now. I wish it were available directly in Zope 3 (or that we were fully eggified). Gary ___

Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-10 Thread Fred Drake
On 3/9/06, Stephan Richter <[EMAIL PROTECTED]> wrote: > 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. That's only a disadvantage if you don't want to allow a subclass to use them; that can be useful at times

[Zope3-dev] Re: keeping attributes abstract

2006-03-10 Thread Benji York
Philipp von Weitershausen wrote: Benji's example is also beyond any magic of most of the people. I don't know about that. *Especially* when you're just new to Python. There I'll agree with you. http://codespeak.net/svn/user/philikon/rwproperty/. I like this type of approach better, but

Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-10 Thread Martijn Faassen
Lennart Regebro wrote: On 3/10/06, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote: 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/. Yeah, that´s much better and is how I would have

Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-09 Thread Lennart Regebro
On 3/10/06, Philipp von Weitershausen <[EMAIL PROTECTED]> wrote: > 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/. Yeah, that´s much better and is how I would have expected it to be done

[Zope3-dev] Re: keeping attributes abstract

2006-03-09 Thread Philipp von Weitershausen
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

Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-09 Thread Stephan Richter
On Thursday 09 March 2006 06:09, Marko Mikulicic 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

Re: [Zope3-dev] Re: keeping attributes abstract

2006-03-09 Thread Marko Mikulicic
On 09.03.2006., at 11:43, Sam Stainsby wrote: On Thu, 09 Mar 2006 04:29:12 -0500, Benji York wrote: class Foo(Persistent): implements(IFooB) @apply def bar(self): doc = """The bar attribute""" def fset(self, bar): if bar is None:

[Zope3-dev] Re: keeping attributes abstract

2006-03-09 Thread Sam Stainsby
On Thu, 09 Mar 2006 04:29:12 -0500, Benji York wrote: > class Foo(Persistent): > implements(IFooB) > > @apply > def bar(self): > doc = """The bar attribute""" > > def fset(self, bar): > if bar is None: > self._bar = 47 >