The following code:
import concurrent.futures
def worker(item, truefalse):
print(item, truefalse)
return item
processed = []
with concurrent.futures.ThreadPoolExecutor() as pool:
for res in pool.map(worker, [1,2,3], False):
processed.append(res)
Yields an exception: TypeError: zip argument #2 must support iteration
I also tried: for res in pool.map(worker, ([1,2,3], False)):
Which yields: TypeError: worker() missing 1 required positional argument: 'truefalse'
How does one pass multiple arguments to the function in calling ThreadPoolExecutor.map()?