On 05/14/2012 07:38 PM, Chris Kaynor wrote: > On Sun, May 13, 2012 at 12:11 PM, Bob Grommes <bob.grom...@gmail.com> wrote: >> <SNIP> >> >> The rule is that, if two objects return different results from >> __hash__, they should never compare equal. The opposite rule also >> holds true: if two objects compare equal, they should return the same >> value from __hash__. >>
You state those as if they were different rules. Those are contrapositives of each other, and therefore equivalent. The inverse would be that two objects with the same __hash__ should compare equal, and that's clearly not true. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list