All pastes #901353 Raw Edit

Someone

public text v1 · immutable
·published 2008-02-12 16:23 UTC
rendered paste body
class Foo(object):
    def __init__(self, v = 42):
        self._foo = v

    def get_foo(self):
        return self._foo

    def set_foo(self, v):
        self._foo = v

    foo = property(get_foo, set_foo)
    
class Bar(Foo):
    def get_foo(self):
        return self._foo * 42
    foo = property(get_foo, Foo.set_foo)

f=Bar()
print f.foo
f.foo = 1
print f.foo