On 9/28/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > The question is whether it's worth the effort to raise TypeError when > the *potential* exists that a certain hash sequence *could* raise this > TypeError.
Bugs depending on the hash sequence are exactly the sort of thing that doesn't get found by tests, and can't be easily reproduced. > I'm less and less convinced -- after all, we're making the > exception only for bytes/str, not for other types that might raise > TypeError upon comparison. What would those other types be? As you point out in the "Bytes and the Str Type" section, this exception violates the "general rule that comparing objects of different types for equality should just return False". In Py3, there are plenty of types that aren't orderable, but I still can't think of any[*] others that raise an exception when tested just for equality. [*] It is of course possible to write a malicious class, and it is possible to write a buggy class. Even then, most buggy classes fail when compared to anything from any other class, rather than just for specific banned comparisons. -jJ _______________________________________________ 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