Overwrite only one function with property()

George Sakkis george.sakkis at gmail.com
Sat Nov 18 17:27:03 EST 2006


Kai Kuehne wrote:

> Hi list!
> It is possible to overwrite only one function with the property-function?
>
> x = property(getx, setx, delx, 'doc')
>
> I just want to overwrite setx, but when I set the others to None,
> I can't read and del the member. Any ideas or is this not possible?

There are no default functions for getx, setx, delx; you have to
specify what you expect to happen when you write a.p, a.p = v and del
a.p, respectively. What would, for example, be the default getx that
you don't want to overwrite ?

George




More information about the Python-list mailing list