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

Martin v. Löwis wrote [from python-dev]:
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~

On Wed, May 18, 2011 at 5:11 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
I thought it was the other-way-round -- if they hash equal, they should compare equal? Or is this just for immutables?
Two values that compare equal must have equal hashes. Having equal hashes does not imply equality. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> "Give me the luxuries of life and I will willingly do without the necessities." --Frank Lloyd Wright

On Wed, May 18, 2011 at 5:11 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
I thought it was the other-way-round -- if they hash equal, they should compare equal? Or is this just for immutables?
Two values that compare equal must have equal hashes. Having equal hashes does not imply equality. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> "Give me the luxuries of life and I will willingly do without the necessities." --Frank Lloyd Wright
participants (2)
-
Ethan Furman
-
Fred Drake