title: Python: differences among __setitem__ ; setattr ; set
body: <p>simple explanations by examples would do where the 3 of them cannot be interchanged.</p>
  
  <pre><code>def __setitem__(self,**k):
          #self.val=k
          for key in k:
              self.val.setdefault(key,[]).extend(v for v in k[key])
  </code></pre>
  
  <p>Can the above step be done in iterations with setattr(obj,val[,can optional stuff come here??])</p>
  
  <p>WHy not just create our own style and private methods?</p>
  
  <pre><code>def _add(self,**k):
      if isinstance(self, CClass):
          for key in k:
              self.val.setdefault(key,[]).extend(v for v in k[key])
  </code></pre>
  
  <p>Q: Where all a Class's scope allows these private methods to be accessed and used?</p>