Guido van Rossum <[EMAIL PROTECTED]> added the comment: Hi Amaury, thanks for your work on this. I applied your patch and looked at the code but there seem to be some issues left still.
(1) I don't think you need to add a warning to classic classes that define __eq__ without __hash__ -- these aren't hashable and never were. The problem is purely with new classes AFAICT. (2) I can't seen to trigger the warning for new classes (and yes, I specified -3 on the command line :-): >>> class C(object): ... def __eq__(self, other): return False ... >>> hash(C()) -134976284 (3) test_Hashable in test_collections.py fails. This is because the Hashable class believes that list, set, and dict are hashable. Something odd is going on: >>> list.__hash__([]) -135100116 but >>> hash([]) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unhashable type: 'list' Note that in 2.5, both raise TypeError. ---------- assignee: -> amaury.forgeotdarc __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2235> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com