title: Unexpected behavior with multiprocessing Pool
body: <p>In the code below, I was expecting the output to be 2 as I'm changing the value of config before assigning function to pool for multiprocessing, but instead I'm getting 5. I'm sure there is a good reason for it, but not sure how to explain it.</p>
  <pre><code>from multiprocessing import Pool 
  config = 5
  
  class Test:
  
    def __init__(self):
      print(&quot;This is init&quot;)
  
    @classmethod
    def testPrint(cls, data):
      print(config)
      print(&quot;This is testPrint&quot;)
      return config
  
  if __name__ == &quot;__main__&quot; :
    pool = Pool()
    config = 2
    output = pool.map(Test.testPrint, range(10))
    print(output)
  </code></pre>
  <p>Output</p>
  <pre class="lang-none prettyprint-override"><code>5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  5
  This is testPrint
  [5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
  </code></pre>