Remove duplicates in a sequence?

Aahz Maruch aahz at netcom.com
Fri Feb 11 00:26:45 EST 2000


In article <38a39011.603799531 at news1.on.sympatico.ca>,
Robert Roy <rjroy at takingcontrol.com> wrote:
>
>There is a recent thread on this subject. If I recall, what seemed
>fastest was 
>mydict={}
>for item in mylist:
>	mydict[item]=None
>mylist = mydict.keys()

Actually, the Timbot corrected me to point out that

	mydict[item]=1

is slightly faster.
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

Nostalgia just ain't what it used to be



More information about the Python-list mailing list