> All of which is a long-winded way of saying "calculation of an object hash > should be both cheap and idempotent" :)
Actually, I disagree -- I don't see why there's anything wrong with a hash being expensive to calculate the first time you do it. For example, consider a string type in which the hash algorithm examines every character of the string. Those characters had to get there in the first place, so the total time spent computing the hash is no more than a constant multiple of the time spent creating the string. Nevertheless, it seems reasonable to me to defer the effort of computing the hash until you know that it's needed -- that is, until the first time you are asked to compute the hash. If you're going to say that computing the hash isn't expensive compared with dealing with the string itself, then I'll reply that computing the hash of a CD isn't expensive either, if you compare it with dealing with the CD itself :-) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com