Author Antony.Lee
Recipients Antony.Lee
Date 2021-05-03.14:24:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org>
In-reply-to
Content
Adding a call/__call__ function to the operator module (where `operator.call(*args, **kwargs)(func) == func(*args, **kwargs)`, similarly to operator.methodcaller) seems consistent with the design with the rest of the operator module.

An actual use case I had for such an operator was collecting a bunch of callables in a list and wanting to dispatch them to concurrent.futures.Executor.map, i.e. something like `executor.map(operator.call, funcs)` (to get the parallelized version of `[func() for func in funcs]`).
History
Date User Action Args
2021-05-03 14:24:00Antony.Leesetrecipients: + Antony.Lee
2021-05-03 14:24:00Antony.Leesetmessageid: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org>
2021-05-03 14:24:00Antony.Leelinkissue44019 messages
2021-05-03 14:24:00Antony.Leecreate