title: Why are <for i in obj:> and <for i in iter(obj):> equivalent?
body: <p>The following example is given by the <a href="https://docs.python.org/dev/howto/functional.html#iterators" rel="nofollow noreferrer">documentation</a>:</p>
  <blockquote>
  <p>In the statement <code>for X in Y</code>, Y must be an iterator or some object for which <code>iter()</code> can create an iterator. These two statements are equivalent:</p>
  <pre><code>for i in iter(obj):
      print(i)
  
  for i in obj:
      print(i)
  </code></pre>
  </blockquote>
  <p>According to this same <a href="https://docs.python.org/3/tutorial/classes.html#iterators" rel="nofollow noreferrer">source</a>,</p>
  <blockquote>
  <p>Behind the scenes, the for statement calls <code>iter()</code> on the container object. The function returns an iterator object that defines the method <code>__next__()</code> which accesses elements in the container one at a time. When there are no more elements, <code>__next__()</code> raises a <code>StopIteration</code> exception which tells the for loop to terminate.</p>
  </blockquote>
  <p>Considering both cases, when Y is an iterator or some object for which iter() can create an iterator,</p>
  <ul>
  <li>if Y is an iterable (has an <code>iter()</code> method), the <em>for</em> statement calls this method and returns an iterator whose <code>next()</code> method is used to iterate through each element of Y. I assume this is the second example above.</li>
  <li>if Y is an iterator (has both an <code>iter()</code> and <code>next()</code> method), the <em>for</em> statement still calls  the <code>iter()</code> method, but because it's an iterator, it returns it<code>self</code>, and the <code>next()</code> method is called as usual. I assume this is the first example above.</li>
  </ul>
  <p>My question being, is my line of reasoning correct? I don't mind if you point out any misuse of a definition.</p>