Ah, fair point. Just looked into it and it looks like the named functions do indeed avoid the set casting. Ran some timeit and looks like this is indeed the right way to go about it. Operators are faster on sets and named functions are faster on other iterables. I retract my previous comment.