title: TypeError: 'long' object is not callable
body: <p>I have steam coming out of my head now but I can't figure out what is wrong with my code.
  Here are the relevant lines:</p>
  
  <pre><code> try:
     outport = record_dict[id][hash_ % len(record_dict[id])]
   except:
     fp.write("Problem-"+str(type(record_dict[id]))+"\n")
     fp.write("Problem-"+str(record_dict[id])+"\n")
     fp.write("Problem-"+str(len(record_dict[id]))+"\n")
  </code></pre>
  
  <p>Here is the error I get:</p>
  
  <pre><code>  File "xxxx.py", line 459, in yyyyy
      fp.write("Problem-"+str(len(record_dict[id]))+"\n")
    TypeError: 'long' object is not callable 
  </code></pre>
  
  <p>Inside file pointed by fp:</p>
  
  <pre><code>Problem-&lt;type 'list'&gt;
  Problem-[5, 6, 7, 8]
  </code></pre>
  
  <p>What is wrong with my code? How do I debug it?</p>