Eliminating duplicates entries from a list efficiently

Roger Binns rogerb at rogerbinns.com
Sat Jul 3 04:33:56 CEST 2004

Paul wrote:
> Can anyone suggest an efficient way to eliminate duplicate entries
> in a list?  The naive approach below works fine,

The less naive approach to go to the Python cookbook which contains
lots of recipes for doing all sorts of things, commented on and
improved by the community.

The starting page is:


For example here is a recipe by one Tim Peters that shows how to
do it, including all the subtle cases you didn't even realise


I would highly recommend getting the Python Cookbook dead tree


More information about the Python-list mailing list