title: What's the difference between __iter__ and __getitem__?
body: <p>This happens in Python 2.7.6 and 3.3.3 for me. When I define a class like this</p>
  
  <pre><code>class foo:
      def __getitem__(self, *args):
          print(*args)
  </code></pre>
  
  <p>And then try to iterate (and what I thought would call iter) on an instance, </p>
  
  <pre><code>bar = foo()
  for i in bar:
      print(i)
  </code></pre>
  
  <p>it just counts up by one for the args and prints None forever. Is this intentional as far as the language design is concerned?</p>
  
  <p>Sample output </p>
  
  <pre><code>0
  None
  1
  None
  2
  None
  3
  None
  4
  None
  5
  None
  6
  None
  7
  None
  8
  None
  9
  None
  10
  None
  </code></pre>