title: Applying the pool.starmap() function with multiple arguments on a dict which are both passed as arguments inside the .starmap()
body: <p>I'm currently trying to apply parallel processing on a script. The following is just to simulate the current script I am working on. Basically, I want to call the Pool.starmap() function on a function and a dictionary. The thing is, the function has multiple arguments.  I keep getting this error,</p>
  
  <p>TypeError: read_books() takes 4 positional arguments but 6 were given</p>
  
  <p>I've tried calling the function with the desired arguments, inside pool.starmap(function(arg1, arg2, ar3), dict)</p>
  
  <pre><code>import multiprocessing as mp
  from itertools import product
  
  # dict - key as string, value as a list
  
  library = {
      'horror': ['Book1', 'book2', 'book3'],
      'thriller': ['book3', 'book4', 'book5'],
      'romance': ['book4', 'book5', 'book6']
  }
  
  def read_books(group_friends, library_name, amount_of_hours, key):
  
      for friend in group_friends:
          print(f"friend {group_friends} visits the library to read {key} books")
  
      print(f"They are all at the library {library_name} and spend a total of {amount_of_hours} there.")
  
  
  with mp.Pool(processes=len(library)) as pool:
          results = pool.starmap(read_books, library)
  </code></pre>
  
  <p>I basically just want to execute the read_books function 3 times for each key-value pair</p>