Message320148
| Author | jdemeyer |
|---|---|
| Recipients | jdemeyer |
| Date | 2018-06-21.10:07:32 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1529575652.49.0.56676864532.issue33925@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-06-21 10:07:32 | jdemeyer | set | recipients: + jdemeyer |
| 2018-06-21 10:07:32 | jdemeyer | set | messageid: <1529575652.49.0.56676864532.issue33925@psf.upfronthosting.co.za> |
| 2018-06-21 10:07:32 | jdemeyer | link | issue33925 messages |
| 2018-06-21 10:07:32 | jdemeyer | create | |