title: python: 'dict' object has no attribute 'has_key'
body: <p>I have this piece of code:</p>
  <pre><code>def separate_sets(self):
      self.groups = {}
      self.group_names = list(set(self.y))
      if len(self.group_names) &gt; 2:
          print ('more than two classes provided...exiting')
          sys.exit()
      #putting all the samples in a regular order so that their
      #grouping can be easier.
      combined  = sorted(zip(self.x, self.y), key = lambda n: n[1])
      #--doing val,key here because (x,y) was zipped
      for val,key in combined:
          if self.groups.has_key(key):
              self.groups[key].append(val)
          else:
              self.groups[key] = []
              self.groups[key].append(val)
      #train on each group
      self.train()
  </code></pre>
  <p>And I received the following error message:</p>
  <blockquote>
  <p>if self.groups.has_key(key):</p>
  <p>AttributeError: 'dict' object has no attribute 'has_key'</p>
  </blockquote>