>> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4