fast list search?

ramon aragues ramon.aragues at
Wed Jun 9 11:49:19 CEST 2004


I´ve got a list with more than 500,000 ints. Before inserting new ints, 
I have to check that it doesn´t exist already in the list.

Currently, I am doing the standard:

if new_int not in long_list:

but it is extremely slow... is there a faster way of doing this in python?

Thanks a lot,

Ramon Aragues

More information about the Python-list mailing list