title: TypeError: unhashable type: 'dict' in python
body: <p>I'm getting an error message about dictionaries despite having never used a dictionary anywhere in my code</p>
  
  <p>Here is my code:</p>
  
  <pre><code>mm=[]
  soln=[]
  for i in range(len(momvec)):
      string = str(momvec[i])
      num = string[2:]
      mm.append(Symbol('x'+num))
      print num
      print mm
      soln.append(solve(mom[i]-momvec[i],mm))
  print type(MFK[0])
  for m in range(0,len(MFK)):
      for i in range(0,len(mm)):
          print MFK[m]
          MFK[m]= Subs(MFK[m],mm[i], soln[i]).doit()
  </code></pre>
  
  <p>What I am trying to do is replace some items in the list <code>MFK</code> with what is indicated by <code>mm</code> with the contents of <code>soln</code> iteratively.</p>
  
  <p>The traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "MEA.py", line 313, in &lt;module&gt;
      MFK_final(numMoments)
    File "MEA.py", line 242, in MFK_final
      MFK[m]= Subs(MFK[m],mm[i], soln[i]).doit()
    File "/cluster/soft/linux64/epd/lib/python2.7/site-packages/sympy/core/function.py", line 1270, in __new__
      pts = sorted(set(point), key=default_sort_key)
  TypeError: unhashable type: 'dict'
  </code></pre>
  
  <p>values for mom, momvec and MFK respectively:</p>
  
  <pre><code>[x2 - y_0**2]
  
  [ym2]
  
  [-2*c_0*y_0*(y_0 - 1) - 2*c_0*(-y_0**2 + yx1*(y_0**2/yx1 + 1)) + 2*c_1*(0.5*c_2 - 0.5*y_0), 4.0*c_0*y_0**2 - 4.0*c_0*y_0 + 2.0*c_1*c_2 - 2.0*c_1*y_0 - (-y_0**2 + yx1*(y_0**2/yx1 + 1))*(8.0*c_0*y_0 - 8.0*c_0 + 2.0*c_1)]
  </code></pre>
  
  <p>Printing output to screen it appears as though the first loop goes fine, then it throws the error in the title. Does anyone know how I could solve this?</p>
  
  <p>Many thanks</p>