Skip to content

Instantly share code, notes, and snippets.

@anthonymorast
Created January 8, 2022 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonymorast/6a1847800c85ee0c5729503db5016298 to your computer and use it in GitHub Desktop.
Save anthonymorast/6a1847800c85ee0c5729503db5016298 to your computer and use it in GitHub Desktop.
for value in values:
squares.append(square(value))
## changed to
with Pool(num_procs) as p:
squares = p.map(square, values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment