title: use "in" operator for dictionary in a class
body: <p>I have a __contains__ method in class called "Graph" with an instance "dict" which is a dictionary.  </p>
  
  <pre><code>def __contains__(self,i):
      return i in self.dict
  </code></pre>
  
  <p>Now I would like to use "in" to loop through the keys of "dict." I use:</p>
  
  <pre><code>g = Graph()
  for i in g:
      print(i)
  </code></pre>
  
  <p>The question is: why I get <strong>values</strong> of dict instead of <strong>keys</strong> from <em>i</em>?</p>