Pool.map Несколько аргументов
def unpack_args(func):
from functools import wraps
@wraps(func)
def wrapper(args):
if isinstance(args, dict):
return func(**args)
else:
return func(*args)
return wrapper
@unpack_args
def func(x, y):
return x + y
results = pool.map(func, zip(x,y)) # The function will now pass the variables as lists
Jittery Jay