Re: Invertible id(), or maybe hash the world, or ?
William Lewis (email@example.com)
Tue, 05 Apr 94 10:06:38 -0700
It seems to me that it would be a simpler solution for mapping objects to
simply use the 'id' of an object as its hash if it doesn't provide a hash
method. The 'id' has most of the desirable attributes of a hash: it's
unique, it doesn't change over the lifetime of the object, and it's small
and easily computed. The one thing it's missing is that it doesn't work
for some types (eg strings) for which two different objects can be equal.
But for those objects, we can just have a real hash method.
... William Lewis. ----- firstname.lastname@example.org ------ Seattle, WA, USA
"The mind is not a vessel to be filled, but a fire to be kindled."