No problem at all, as I said, this doesn't matter for my needs since I'm just posting values into a DB. Just curious why it jumbles it all up :)<br><br><div><span class="gmail_quote">On 11/30/06, <b class="gmail_sendername">
Lloyd Kvam</b> <<a href="mailto:lkvam@venix.com">lkvam@venix.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">There is a fly in the ointment that hit me after I sent the email.
<br>Using set does not preserve the order. If you care about the order of<br>elements in list1, my suggestion will not work.<br><br><br>On Thu, 2006-11-30 at 16:01 -0500, Python wrote:<br>> On Thu, 2006-11-30 at 12:51 -0800, Chris Hengge wrote:
<br>> > Anyone point me to something more efficient then<br>> ><br>> list2 = list(set(list1))<br>><br>> Older Pythons will force you to import sets and use sets.Set<br>><br>> > for item in list1:
<br>> > if item not in list2:<br>> > list2.append()<br>> ><br>> > This just seems to take a bit a time when there are thousands or<br>> > dozens of thousands of records just to filter out the dozen or so
<br>> > copies..<br>> ><br>> > Thanks.<br>> > _______________________________________________<br>> > Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>> > <a href="http://mail.python.org/mailman/listinfo/tutor">
http://mail.python.org/mailman/listinfo/tutor</a><br>--<br>Lloyd Kvam<br>Venix Corp.<br>1 Court Street, Suite 378<br>Lebanon, NH 03766-1358<br><br>voice: 603-653-8139<br>fax: 320-210-3409<br><br></blockquote></div><br>