title: Get the types of the keys in a dictionary
body: <p>Is there a &quot;clean&quot; way to take the type of the keys of a dictionary in python3?</p>
  <p>For example, I want to decide if one of this dictionaries has keys of type <code>str</code>:</p>
  <pre><code>d1 = { 1:'one', 2:'two', 5:'five' }
  d2 = { '1':'one', '2':'two', '5':'five' }
  </code></pre>
  <p>There is several ways to achieve this, for example, using some as:</p>
  <pre><code>isinstance(list(d2.keys())[0], type('str'))
  </code></pre>
  <p>But this is quite annoying because <code>d2.keys()</code> is not indexable, so you need to convert it into a list just to extract the value of one element of the list and check the type.</p>
  <p>So has python3 something as <code>get_key_type(d2)</code>?
  If not, is there a better (cleaner) way to ask if the key of a dictionary is of type <code>str</code>?</p>