title: class, dict, self, init, args?
body: <pre><code>class attrdict(dict):
      def __init__(self, *args, **kwargs):
          dict.__init__(self, *args, **kwargs)
          self.__dict__ = self
  
  a = attrdict(x=1, y=2)
  print a.x, a.y
  
  b = attrdict()
  b.x, b.y  = 1, 2
  print b.x, b.y
  </code></pre>
  
  <p>Could somebody explain the first four lines in words? I read about classes and methods. But here it seems very confusing.</p>