title: Creating dictionary of dictionaries in python 2.6
body: <p>I have a line of code in python2.7 that generates a dictionary of empty dictionaries:</p>
  
  <pre><code>values=[0,1,2,4,5,8] 
  value_dicts={x:{} for x in values}
  </code></pre>
  
  <p>which throws a syntax error when run on python2.6. </p>
  
  <p>I can do the same thing using a for loop:</p>
  
  <pre><code>values_dicts={}
  values=[0,1,2,4,5,8]
  for value in values :
  values_dicts[value]={}
  values_dicts
  Out[25]: {0: {}, 1: {}, 2: {}, 4: {}, 5: {}, 8: {}}
  </code></pre>
  
  <p>But that seems silly. Why does the list comprehension (in the first block) not work in python2.6?</p>