"Roel Schroeven" <[EMAIL PROTECTED]> wrote

>> In that case put the inner lists in a Set. That will eliminate
>> duplicates.
>
> That won't work: list objects are unhashable so you can't put them 
> in a
> set. You'll have to convert them to tuples first.

Hmm, I took that a self evident but I guess maybe it wasn't...

As for Luke's point about the speed of conversion, I'm not
sure how that would stack up. I have a gut feel that it might
be faster than trying to compare the lists element by
element, that sounds like an algebraic expansion with list
size to me, a hashed set sounds like it should be faster.
But as with all such things, if speed matters: measure
and profile it.

Alan G. 


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to