[Python-ideas] [Python-Dev] Python 3.x and bytes

Ethan Furman ethan at stoneleaf.us
Wed May 18 23:11:10 CEST 2011


Martin v. Löwis wrote [from python-dev]:
> 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?  Or is this just for immutables?

> In addition, equality should be transitive, so b'A' == 65.0.

I'm not sure what you're getting at...  we could certainly have step 2
check for a number instead of an int, and then step 3 could extract the
one element, giving an int, and then let that int compare itself with
the other number, whether it be int, float, fraction, what-have-you.


~Ethan~




More information about the Python-ideas mailing list