[Python-3000] Help needed in py3k branch

Brett Cannon brett at python.org
Fri Apr 21 01:00:23 CEST 2006


On 4/20/06, Guido van Rossum <guido at python.org> wrote:
> There are still a bunch of tests failing in the py3k (sic) branch:
>
> test_class fails because hash() of a new-style class that defines
> __eq__ or __cmp__ doesn't raise an exception. There's a design issue
> here: should the default hash be changed to raise an exception in this
> case (perhaps triggering other test failures) or should the tests be
> deleted? (This is from a test module that used to test classic
> classes.)
>

I say raise an exception.  iter() raises a TypeError if you pass it an
object it can't get an iterator for.  hash() should raise an exception
for an object that cannot be used as a key in a dict.

-Brett


More information about the Python-3000 mailing list