Yet another unique() function...

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Feb 28 02:25:05 EST 2007


MonkeeSage:
> Here's yet another take on a unique() function for sequences. It's
> more terse than others I've seen and works for all the common use
> cases (please report any errors on the recipe page):

It's more terse, but my version is built to be faster in the more
common cases of all hashable or/and all sortable items (while working
in other cases too).
Try your unique on an unicode string, that's probably a bug (keepstr
is being ignored).
Version by Paul Rubin is very short, but rather unreadable too.

Bye,
bearophile




More information about the Python-list mailing list