George Sakkis wrote: > "Lasse Vågsæther Karlsen" <[EMAIL PROTECTED]> wrote: <snip> >>I think I'll re-write to use a list instead > > > Actually in most cases you don't need to assume it's a list; any > iterable is usually good enough. You can always turn it into a list (or > a tuple or a set or..) in the function if you really have to. So when > you do have to and when you don't ? You don't have to if all you do is > iterate over the elements. This is true even if you want to iterate > more than once; just use the itertools.tee() function to create N > independent iterators. To sum up, a better signature for your function > is likely to be "def fn(iterable, cmp=cmp)".
Yep, that sounds like a plan :) -- Lasse Vågsæther Karlsen http://usinglvkblog.blogspot.com/ mailto:[EMAIL PROTECTED] PGP KeyID: 0x2A42A1C2 -- http://mail.python.org/mailman/listinfo/python-list