Alexander Belopolsky <[EMAIL PROTECTED]> added the comment: On Wed, Apr 16, 2008 at 9:24 PM, Benjamin Peterson wrote: .. > Why not just hash a tuple?
There are a few reasons, but neither is good enough to have another round of code review :-) 1. It is strange to have the hash function allocate new objects. If that was a type frequently used as a dict key, I would be concerned about a possibility that dictionary lookup may trigger gc. 2. While reproducing hash(tuple) is a good starting point, there may be a reason to choose different values for the magic constants. 3. If you don't want to mess with hash(tuple) complexity, a simple xor of start/stop/step hashes (maybe with a check to prevent accidental -1 return) should be good enough. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2603> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com