Helmut Jarausch wrote: > I need to hash arrays of integers (from the hash module). > > So, I have to derive from array and supply a __hash__ method. > But how to hash an array (of fixed length, say 25)? > What I need is a function which maps a tuple of 25 integers > into 1 integer with good hashing properties. > > Does anybody know such a thing?
Have you tried this already? def __hash__(self): return hash(self.tostring()) Peter -- http://mail.python.org/mailman/listinfo/python-list