def obj(): return {'data':'hello', 'add':add(v)} def add(v): data=data+v if __name__ == '__main__': test=obj() test.add('world') print test.data I don't know why but i have one of does none class c programing style moods again. I was wondering if the following was possible without using a class ?