The fastest way to remove duplicates from a sequence depends on some pretty subtle properties of the sequence elements, such as whether they're hashable, and whether they support full comparisons. This script defines the unique() function that tries three methods, from fastest to slowest, letting runtime exceptions pick the best method available for ...