class attrdict(dict):

    def __init__(self, *args, **kwargs):
        dict.__init__(self, *args, **kwargs)
self.__dict__ = self
a = attrdict(x=1, y=2)
JavaScript-like Object in Python standard library?