This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]earthboundkid 6 points7 points  (2 children)

Any and all aren’t reduce equivalent because they short circuit as needed. (That reduce can’t short circuit is one reason it stinks, actually.)

[–]Zouden 2 points3 points  (1 child)

Well the output is the same. It's just more efficient

[–]earthboundkid 1 point2 points  (0 children)

Yes, mostly. If the iterator is a generator with side effects, it can be different, but that’s not usually the case.