def __getattr__(self, value):
    return self.__dict__['_odict'][value]

def __setattr__(self, key, value):
    self.__dict__['_odict'][key] = value
a = A()
a
a.x = 1
a.x
a.y = 2
a.y
a.odict
Using an ordered dict as object dictionary in python