Message392809
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]`). |
|
Date |
User |
Action |
Args |
2021-05-03 14:24:00 | Antony.Lee | set | recipients:
+ Antony.Lee |
2021-05-03 14:24:00 | Antony.Lee | set | messageid: <1620051840.28.0.198895693226.issue44019@roundup.psfhosted.org> |
2021-05-03 14:24:00 | Antony.Lee | link | issue44019 messages |
2021-05-03 14:24:00 | Antony.Lee | create | |
|