title: Will dict(**kwargs) always give dictionary where Keys are of type string?
body: <p><strong>Note</strong> : This is <strong>not a duplicate</strong> of the <a href="https://stackoverflow.com/questions/664118/whats-the-difference-between-dict-and">linked answer</a>, that focuses on issues related to performance, and what happens behind the curtains when a dict() function call is made. My Question is about keyword arguments always resulting in keys of type <code>string</code>. Definitely not a duplicate.</p>
  
  <hr/>
  
  <p>Method-1 :</p>
  
  <pre><code>suit_values = {'spades':3, 'hearts':2, 'diamonds':1, 'clubs':0}
  </code></pre>
  
  <p>Method-2 :</p>
  
  <pre><code>suit_values = dict(spades=3, hearts=2, diamonds=1, clubs=0)
  </code></pre>
  
  <p>Method-1 makes sense to me. It's like telling python to give me a dictionary where <strong>keys are strings</strong> and <strong>values are numerics</strong>. But in Method-2, how does python know that the keys are strings and not something else ?</p>
  
  <p>Is this a trend? if so, some other examples (apart from dictionaries) that show this kinda behavior ?</p>
  
  <p><strong>EDIT-1</strong> :</p>
  
  <p>My understanding from the answers is :</p>
  
  <ol>
  <li>Method-2 is the <code>dict(**kwargs)</code> way of creating a dictionary.</li>
  <li>In <code>spades=3</code>, <code>spades</code> is a valid Python identifier, so it is taken as a key of type <strong><code>string</code></strong> . </li>
  </ol>
  
  <p>So, will <code>dict(**kwargs)</code> <strong>always</strong> result in a dictionary where the keys are of type <code>string</code> ? </p>
  
  <p><strong>EDIT-2</strong> : ^^ YES.</p>