[issue3500] unbound methods of different classes compare equal

2010-12-21 Thread R. David Murray
R. David Murray added the comment: Since 2.7 has been released and this behaviour could not be changed in a point release even if agreement that it was a good change was reached, and since it is meaningless in 3.x, I'm closing this issue. -- nosy: +r.david.murray resolution: -> rejec

[issue3500] unbound methods of different classes compare equal

2008-08-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Hi, > It's the same function attached to two different classes. I don't > really buy the "implementation detail" argument - if Guido says it, > then I don't have much choice but to accept it, but I'm going to > argue about it with anyone els

[issue3500] unbound methods of different classes compare equal

2008-08-05 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: > But you acknowledge they are really the same method attached to > different classes, right? The notion of "unbound method" is mostly an > implementation detail. The term occurs only 4 times in the whole Python > documentation (according

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Apparently Roundup snipped my numbers example :-) Here it is, hoping it will pass through this time : >>> d = {} >>> d[1] = 'a' >>> d[1.0] = 'b' >>> d[1] 'b' ___ Python tracker <[EMAIL PROTECTED]>

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: > The reason I noticed this is that since they compare and hash equal, if > you put two such methods into a set, you end up with a set with one > method. Currently, this is preventing me from running two test methods > because the method itse

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Jean-Paul Calderone
Jean-Paul Calderone <[EMAIL PROTECTED]> added the comment: The reason I noticed this is that since they compare and hash equal, if you put two such methods into a set, you end up with a set with one method. Currently, this is preventing me from running two test methods because the method itself

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Well, I'm not sure. One could also argue that 1 and 1.0 mustn't compare equal because they cannot be used equally in all circumstances (e.g. __index__), they have different repr's, different types, etc. The question is: what kind of use case

[issue3500] unbound methods of different classes compare equal

2008-08-04 Thread Jean-Paul Calderone
New submission from Jean-Paul Calderone <[EMAIL PROTECTED]>: If a method is inherited by two different classes, then the unbound method objects which can be retrieved from those classes compare equal to each other. For example: Python 2.6b2+ (trunk:65502M, Aug 4 2008, 15:05:07) [GCC 4.0.3