When the function is set explicitly in the submit() function executorlib raises and error message:
ExecutorBase.submit() missing 1 required positional argument: 'fn'
For example:
import executorlib
def sum_funct(a,b):
return sum([a, b])
with executorlib.SingleNodeExecutor() as exe:
f = exe.submit(fn=sum_funct, a=1, b=2)
print(f.result())
This behavior is consistent with the concurrent.futures.ThreadPoolExecutor which raises a similar error message:
from concurrent.futures import ThreadPoolExecutor
def sum_funct(a,b):
return sum([a, b])
with ThreadPoolExecutor() as exe:
f = exe.submit(fn=sum_funct, a=1, b=2)
print(f.result())
Raises:
TypeError: ThreadPoolExecutor.submit() missing 1 required positional argument: 'fn'
Still there were older versions of executorlib<=1.0.1 which did not raise this error message.