"Pablo Torres N." <tn.pablo at gmail.com> writes: > def split(seq, func=bool): > t = filter(func, seq) > f = filter(lambda x: not func(x), seq) > return list(t), list(f) That is icky--you're calling func (which might be slow) twice instead of once on every element of the seq.