title: convert string to dict using list comprehension
body: <p>I have came across this problem a few times and can't seem to figure out a simple solution.
  Say I have a string</p>
  
  <pre><code>string = "a=0 b=1 c=3"
  </code></pre>
  
  <p>I want to convert that into a dictionary with a, b and c being the key and 0, 1, and 3 being their respective values (converted to int). Obviously I can do this:</p>
  
  <pre><code>list = string.split()
  dic = {}
  for entry in list:
      key, val = entry.split('=')
      dic[key] = int(val)
  </code></pre>
  
  <p>But I don't really like that for loop, It seems so simple that you should be able to convert it to some sort of list comprehension expression. And that works for slightly simpler cases where the <code>val</code> can be a string.</p>
  
  <pre><code>dic = dict([entry.split('=') for entry in list])
  </code></pre>
  
  <p>However, I need to convert val to an int on the fly and doing something like this is syntactically incorrect.</p>
  
  <pre><code>dic = dict([[entry[0], int(entry[1])] for entry.split('=') in list])
  </code></pre>
  
  <p>So my question is: is there a way to eliminate the for loop using list comprehension? If not, is there some built in python method that will do that for me?</p>