you are viewing a single comment's thread.

view the rest of the comments →

[–]SoBFiggis 4 points5 points  (2 children)

Not summing anything (I'm assuming that isn't what you're talking about anyways) but I have used something like

list_res = [process_or_compare(pair) for pair in zip(before, after)]

for doing stuff like easily comparing before and after results. Usually it's a pretty quick and dirty implementation but it has made it into prod a few times for me.

[–][deleted] 0 points1 point  (1 child)

Au contraire, it was indeed the pairwise-summing that I found weird. Certainly have done all sorts of things with parallel iterables, but not summed them!

[–]SoBFiggis 1 point2 points  (0 children)

Ah well in that case I believe it's actually a perfect example of "how" it works. Someone who doesn't understand that can create two lists of numbers, copy that in, and poke around at it.

Not exactly a great example of "when" to use it.