title: Multiprocessing example giving AttributeError
body: <p>I am trying to implement multiprocessing in my code, and so, I thought that I would start my learning with some examples.  I used the first example found in this <a href="https://docs.python.org/3/library/multiprocessing.html#introduction" rel="noreferrer">documentation</a>.</p>
  
  <pre><code>from multiprocessing import Pool
  def f(x):
      return x*x
  
  if __name__ == '__main__':
      with Pool(5) as p:
          print(p.map(f, [1, 2, 3]))
  </code></pre>
  
  <p>When I run the above code I get an <code>AttributeError: can't get attribute 'f' on &lt;module '__main__' (built-in)&gt;</code>.  I do not know why I am getting this error.  I am also using Python 3.5 if that helps.</p>