Message263001
Proposed patch fixes several bugs in plistlib.Data.__eq__().
* isinstance(other, str) was used instead of isinstance(other, bytes). Data always wraps bytes and should be comparable with bytes. str was correct type in Python 2.
* id(self) == id(other) is always false, because if other is self, the first condition (isinstance(other, self.__class__)) should be true. NotImplemented should be returned as fallback. This allows comparing with Data subclasses and correct work of __ne__().
* The __eq__() method should be used instead of the equality operator. This is needed for correct work in case if value is bytes subclass with overloaded __eq__(). |
|
Date |
User |
Action |
Args |
2016-04-07 20:06:42 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ronaldoussoren |
2016-04-07 20:06:42 | serhiy.storchaka | set | messageid: <1460059602.28.0.307914137302.issue26711@psf.upfronthosting.co.za> |
2016-04-07 20:06:42 | serhiy.storchaka | link | issue26711 messages |
2016-04-07 20:06:42 | serhiy.storchaka | create | |
|