Neal Becker wrote: > I like to hash a list of words (actually, the command line args of my > program) in such a way that different words will create different hash, > but not sensitive to the order of the words. Any ideas?
You mean a typical python hash value which would be /likely/ to differ for different lists and /guaranteed/ to be equal for equal lists is not good enough? Because that would be easy: args = sys.argv[1:] hash(tuple(sorted(args))) # consider duplicate args hash(frozenset(args)) # ignore duplicate args -- http://mail.python.org/mailman/listinfo/python-list