Enhanced property decorator

Daniel millerdev at gmail.com
Mon Aug 25 22:00:33 EDT 2008


On 25 Aug, 21:52, Benjamin <musiccomposit... at gmail.com> 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 self._prop

Hmm, interesting. I wonder if it suppports setting the doc-string in a
similar way? I'll have to look into that. Thanks for pointing this
out.

~ Daniel



More information about the Python-list mailing list