Simple - looking for a way to do an element exists check..

Paul Rubin http
Sat Feb 23 20:24:16 EST 2008


thebjorn <BjornSteinarFjeldPettersen at gmail.com> writes:
> If the lists are long enough to care, either rewrite use a set-based
> solution if the items are hashable, or keep the elements sorted and
> rewrite to use the bisect module if the elements can be ordered.

Well, you want a tree data structure to have fast insertions to
remember what items have already been seen.  There's been a bunch
of proposals for an ordered dict type that works like this.

Some day...



More information about the Python-list mailing list