You can use the @property decorator.
@property
class foo(object): bar = "bar" @property def baz(self): return "baz"
Take a look at the decorator form of property.
@propertydef baz(self): return "baz"