>> Immutable objects that compare equal should hash equal; >> so we would also have to change the hashing of byte strings. Not sure >> whether that, in turn, has undesirable consequences. > > I thought it was the other-way-round -- if they hash equal, they should > compare equal?
No no no. If they hash equal, it could just be a hash collision - objects of a class could all hash to 42, if they wanted to. Dictionaries require the property I mentioned. If they compare equal, but hash differently, a dictionary lookup would fail to find the key. >> In addition, equality should be transitive, so b'A' == 65.0. > > I'm not sure what you're getting at... That it is counter-intuitive to have a bytes object compare equal to a floating-point number. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com