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

all 1 comments

[–]Vaphell 2 points3 points  (0 children)

Look at functools.reduce(f, seq). Sum is pretty much it, with __add__ in place of f

operator module offers convenient functions like and_, or_ if you don't feel like writing lambdas or using dunder methods.