The easiest way to fill one with the dictother is the methodupdate() , so if you expand objectto provide an object has __dict__, you can try something like this:
>>> class Site(object):
... pass
...
>>> site = Site()
>>> site.__dict__.update(dict)
>>> site.a
Or perhaps even:
>>> class Site(object):
... def __init__(self,dict):
... self.__dict__.update(dict)
...
>>> site = Site(dict)
>>> site.a
source
share