This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2018年06月21日 10:07 by jdemeyer, last changed 2022年04月11日 14:59 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg320148 - (view) | Author: Jeroen Demeyer (jdemeyer) * (Python triager) | Date: 2018年06月21日 10:07 | |
Methods of Python functions compare equal if the functions are equal and if __self__ is equal: >>> class X: ... def __eq__(self, other): return True ... def meth(self): pass >>> X().meth == X().meth True This is because X() == X() even though X() is not X(). For extension types, we get instead: >>> [].append == [].append False This is because comparison is done with "is" instead of "==". This is a needless difference. |
|||
| msg320153 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2018年06月21日 10:55 | |
This is a duplicate of issue1617161. |
|||
| msg320166 - (view) | Author: Jeroen Demeyer (jdemeyer) * (Python triager) | Date: 2018年06月21日 11:21 | |
> This is a duplicate of issue1617161. Well, it's really the opposite. That issue seems to be arguing that __self__ should be compared using "is" while I think it should be compared using "==". |
|||
| msg320181 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2018年06月21日 13:31 | |
This is still a duplicate issue, though, you are just arguing for a different resolution of the other one :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:59:02 | admin | set | github: 78106 |
| 2018年06月21日 13:31:52 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg320181 |
| 2018年06月21日 11:21:24 | jdemeyer | set | messages: + msg320166 |
| 2018年06月21日 10:55:07 | serhiy.storchaka | set | status: open -> closed superseder: Instance methods compare equal when their self's are equal nosy: + serhiy.storchaka messages: + msg320153 resolution: duplicate stage: resolved |
| 2018年06月21日 10:07:32 | jdemeyer | create | |