[Python-Dev] getting rid of default object.hash (SF 660098) (original) (raw)

Guido van Rossum guido at python.org
Mon Dec 22 17:13:02 EST 2003


> >>> object.hash() > 135328576 > >>> object.hash(42) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: expected 0 arguments, got 1 > >>>

Would it be better if object.hash() raised a NotImplementedError?

It can't -- it's type.hash(object).

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list