# -*- coding: utf-8 -*- class Wrapper(object): def __init__(self): self._object = {} def update(self, **kw): self._object = kw def __getattr__(self, attr): return self._object[attr] class Test(Wrapper): def __init__(self): self._object = {'name': 'toto'} t = Test() t.update(name='tata') print t.name