title: How does the `for` loop work on dictionaries specifically
body: <p>I was wondering how exactly the <code>for</code> loop accesses keys in a dictionary ?
  does it call <code>dict.keys()</code> and iterate through that list ?</p>
  
  <p>The reason I'm asking is that I want to query a dictionary's key, any key, and I was wondering if there is a difference in performance (aside from visuals and readability) between calling:</p>
  
  <pre><code>for key in dict:
      my_func(dict[key])
      break
  </code></pre>
  
  <p>and</p>
  
  <pre><code>my_func(dict.keys()[0]) 
  </code></pre>
  
  <p>Which brought me to the above question - what does python do during a <code>for</code> loop on <code>dict</code>s, specifically, under the hood?</p>