fast list search?
From: ramon aragues (ramon.aragues_at_gmx.net)
Date: 06/09/04
- Next message: Aaron Brady: "Re: Python Speed Question and Opinion"
- Previous message: Sergey Krushinsky: "Constructor overloading"
- Next in thread: Thomas Guettler: "Re: fast list search?"
- Reply: Thomas Guettler: "Re: fast list search?"
- Reply: Peter Otten: "Re: fast list search?"
- Reply: Javier Zaragozá Arenas: "Re: fast list search?"
- Maybe reply: Phil Frost: "Re: fast list search?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 09 Jun 2004 11:49:19 +0200 To: python-list@python.org
Hi,
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:
long_list.append(new_int)
but it is extremely slow... is there a faster way of doing this in python?
Thanks a lot,
Ramon Aragues
- Next message: Aaron Brady: "Re: Python Speed Question and Opinion"
- Previous message: Sergey Krushinsky: "Constructor overloading"
- Next in thread: Thomas Guettler: "Re: fast list search?"
- Reply: Thomas Guettler: "Re: fast list search?"
- Reply: Peter Otten: "Re: fast list search?"
- Reply: Javier Zaragozá Arenas: "Re: fast list search?"
- Maybe reply: Phil Frost: "Re: fast list search?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|