I have a class like this:
class Foo(object): def __init__(self): self.bar = property(self.get_bar) def get_bar(self): return \"bar\" pr
You need to make a minor change:
class Foo(object): def get_bar(self): return "bar" bar = property(get_bar) print Foo().bar # prints bar
The property needs to be an attribute of the class, not the instance; that's how the descriptor protocol works.