title: Strange behavior using Python multiprocessing library
body: <p>I am trying to read a file using python <code>multiprocessing</code> library but not getting the desired results. Here goes the code that I am using:</p>
  
  <pre><code>import multiprocessing as mp
  import itertools
  
  partitioned = {}
  partitioned['0-20'] = []
  partitioned['20-40'] = []
  partitioned['40-60'] = []
  partitioned['60+'] = []
  output = []
  
  def map_func1(f):
      # for line in f:
      gen = f[14:15] #15 1=male 2=female
      age = f[17:19] #18-19
      htin = f[1947:1950] #1948-1950 tall in inches, self reported !888! !999!
      wtlbs = f[1950:1953] #1951-1953 wt in lbs, self reported !888! !999!
      ovwt = f[1963:1964] #1964 consider myself overweight 1,under 2,over 3, !8!, !9!
      chwt = f[1964:1965] #1965 change weight or stay same 1=more, 2=less, 3=same, !8!, !9!
      output.append([gen, age, htin, wtlbs, ovwt, chwt])
      return output
  
  def partitioner(m):
      for element in m:
          if int(element[1]) &lt; 20:
              output['0-20'].append(element)
          elif int(element[1]) &lt; 40:
              output['20-40'].append(element)
          elif int(element[1]) &lt; 60:
              output['40-60'].append(element)
          else:
              output['60+'].append(element)
  
      return partitioned
  
  if __name__ == "__main__":
      pool = mp.Pool(processes=3)
      f = open('adult.dat')
      m = pool.map(map_func1, f)
      print len(output)
      print len(m)
      p = partitioner(m)
      print p
  </code></pre>
  
  <p>Here goes the output that I receive:</p>
  
  <pre><code>TypeError: int() argument must be a string or a number, not 'list'
  0
  20050
  </code></pre>
  
  <p>I have the following problems:</p>
  
  <ol>
  <li><p>I don't understand why in the aforementioned code, the length of <code>output</code> is 0 and the length of the variable <code>m</code> is 20050. According to me, both, <code>output</code> and <code>m</code>, should be of length 20050. </p></li>
  <li><p>Why the <code>TypeError()</code> in this case? Why can the argument not be a list in the <code>partitioner</code> function?</p></li>
  <li><p>When I try to see the contents of the variable <code>m</code> in the debugging window, my system almost craps out. (I am using Ubuntu 13.10 and running Pycharm 3.1 on it!) I could understand this if the contents of the list I was trying to view were insanely huge, in this case they aren't. It is a list of 20050 lists, each having 6 elements.</p></li>
  </ol>
  
  <p>Any help in this regard will be highly appreciated.</p>