Message320148
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. |
|
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 | |
|