[Python-3000] hash as attribute/property

Delaney, Timothy (Tim) tdelaney at avaya.com
Wed Apr 5 02:47:36 CEST 2006


Guido van Rossum wrote:

>> __hash__() isn't always O(1), so in my world it wouldn't be a
>> property. 
> 
> I like this best of all the arguments presented so far, and consider
> the case closed.
> 
> (The weakness of the argument "but hash() can take a long time to
> compute" is that a good hash function is supposed to be fast. But this
> doesn't mean it can't have an O(N) component somewhere, e.g. for
> tuples.)

That seems like a good determinant to me. Perhaps it should be added to
PEP err ... 3000? Doesn't quite seem to fit - maybe needs a new section.

Tim Delaney


More information about the Python-3000 mailing list