On Wed, 26 Jan 2005 06:45:29 -0800 (PST), Klaus Neuner <[EMAIL PROTECTED]> wrote: > what is the fastest way to determine whether list l (with > len(l)>30000) contains a certain element?
If the list isn't sorted, I doubt you'll do better than
if an_element in my_list:
# do whatever
If the list is sorted, have a look at the bisect module.
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/python-list
