
On Wed, Nov 24, 2021 at 12:39 AM Stephen J. Turnbull <stephenjturnbull@gmail.com> wrote:
Chris Angelico writes:
On Tue, Nov 23, 2021 at 7:47 PM Stephen J. Turnbull <stephenjturnbull@gmail.com> wrote:
There's also implementing zip's strict argument, eg,
def zippymap(func, *iterables, strict=False): return map(lambda x: func(*x), zip(*iterables, strict))
and corresponding zippymappers for any other mappers (including filter). This seems like it might be useful extension to the functions in the stdlib for the same reason that it's useful for zip itself. Even though it's so easy to implement in terms of zip, it would be more discoverable as a documented argument to the functions.
Comments?
Given that I don't actually want a pipeline like this, I'm not the best one to ask, but I would strongly favour ultra-simple APIs.
Ah, but I changed the subject here. Sorry about not making that clear. This isn't a method on a dataflow, it would be a a change to map itself.
Oh, oh, gotcha. That may be worth doing, yeah. It doesn't make a lot of sense in the pipeline form, but map() as it currently is could benefit from that. Prior comment withdrawn as it was responding to what you weren't saying :) ChrisA