Removing dupes from a list

les ander les_ander at yahoo.com
Sat Apr 27 14:58:34 EDT 2002


Alex Martelli <aleax at aleax.it> wrote in message news:<Jvjy8.66361$vF6.2030499 at news2.tin.it>...
> Alexander Skwar wrote:
> 
> > What's the fastest way to make sure that a list only contains unique
> > entries?
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
> 
> 
> Alex


def unique(List):
  return list(dict(zip(List,[None]*len(List))))

les



More information about the Python-list mailing list