![](https://secure.gravatar.com/avatar/334b870d5b26878a79b2dc4cfcc500bc.jpg?s=120&d=mm&r=g)
Paul Moore writes:
mypool for item in items: do_something_here do_something_else do_yet_another_thing
I'm assuming that's the OP's intention (it's certainly mine) is that the "mypool for" loop works something like
def _work(item): do_something_here do_something_else do_yet_another_thing for _ in mypool.map(_work, items): # Wait for the subprocesses pass
I would think that given a pool of processors, the pool's .map method itself would implement the distribution. In fact the Pool ABC would probably provide several variations on the map method (eg, a mapreduce implementation, a map-to-list implementation, and a map-is-generator implementation depending on the treatment of results of the _work computation (if any). I don't see a need for syntax here. Aside: Doesn't the "Wait for the subprocesses" belong outside the for suite?