#!/usr/local/bin/python import ConfigParser class Config(ConfigParser.RawConfigParser): def setfoo(self, value): print 'Setting value=%s' % value self._foo = value def getfoo(self): print 'Getting value=%s' % self._foo return self._foo foo = property(getfoo, setfoo) def main(): config = Config() config.foo = 'bar' print config.foo if __name__ == '__main__': main()