Re: Enhanced property decorator

2008-09-02 Thread Gabriel Genellina
En Mon, 25 Aug 2008 22:45:36 -0300, Daniel <[EMAIL PROTECTED]> escribió: > I've often been frustrated by the inability of the built-in property > descriptor to handle anything other than a read-only property when > used as a decorator. Furthermore, read/write/delete properties take > their doc-str

Re: Enhanced property decorator

2008-08-26 Thread Benjamin
On Aug 25, 9:00 pm, Daniel <[EMAIL PROTECTED]> wrote: > On 25 Aug, 21:52, Benjamin <[EMAIL PROTECTED]> wrote: > > > ... I think Python 2.6 may have > > want you want: > > > class A(object): > > >     @property > >     def my_prop(): return self._prop > > >     @my_prop.setter > >     def my_prop(pr

Re: Enhanced property decorator

2008-08-25 Thread Ben Finney
Daniel <[EMAIL PROTECTED]> writes: > I've often been frustrated by the inability of the built-in property > descriptor to handle anything other than a read-only property when > used as a decorator. The fact that the 'property' function works as a decorator (in, as you point out, some cases only)

Re: Enhanced property decorator

2008-08-25 Thread Daniel
On 25 Aug, 21:52, Benjamin <[EMAIL PROTECTED]> wrote: > ... I think Python 2.6 may have > want you want: > > class A(object): > >     @property >     def my_prop(): return self._prop > >     @my_prop.setter >     def my_prop(prop): self._prop = prop > >     @my_prop.deleter >     def my_prop(): del

Re: Enhanced property decorator

2008-08-25 Thread Benjamin
On Aug 25, 8:45 pm, Daniel <[EMAIL PROTECTED]> wrote: > I've often been frustrated by the inability of the built-in property > descriptor to handle anything other than a read-only property when > used as a decorator. Furthermore, read/write/delete properties take > their doc-string and property def

Enhanced property decorator

2008-08-25 Thread Daniel
I've often been frustrated by the inability of the built-in property descriptor to handle anything other than a read-only property when used as a decorator. Furthermore, read/write/delete properties take their doc-string and property definition at a non-intuitive and awkward place (after the getter