At work, I wrote a Python script which uses the multiprocessing module to process many servers in parallel. The code looks something like:
|
|
I wanted to pass some extra state to processServer
without using a global variable. My first attempt was to use a closure, so I wrote the following: