<jepler <at> unpythonic.net> writes: > def all_pairs(L): > while L: > i = L.pop() > for j in L: yield i, j Interesting. I hadn't thought of this one -- it's not bad other than requiring the list copy (since I need to maintain the original list). Thanks, Steve