Overriding methods in classes that use property()

Edmund Lian elian at inbrief.net
Mon Apr 22 11:49:47 EDT 2002


On Mon, 22 Apr 2002, Denis Otkidach wrote:

>Sorry, getVal is not in current scope. The following should be
>right:
>             val = property(A.getVal, setVal)

Ah, this works. I'm not quite sure that this is intuitive either though.
One would think/expect that val = property(getVal, setVal) would to just
resolve to A.getVal using the inheritance hierarchy when a subclass does
not override getVal.

...Edmund.






More information about the Python-list mailing list