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.

Author serhiy.storchaka
Recipients ronaldoussoren, serhiy.storchaka
Date 2016-04-07.20:06:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460059602.28.0.307914137302.issue26711@psf.upfronthosting.co.za>
In-reply-to
Content
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__().
History
Date User Action Args
2016-04-07 20:06:42serhiy.storchakasetrecipients: + serhiy.storchaka, ronaldoussoren
2016-04-07 20:06:42serhiy.storchakasetmessageid: <1460059602.28.0.307914137302.issue26711@psf.upfronthosting.co.za>
2016-04-07 20:06:42serhiy.storchakalinkissue26711 messages
2016-04-07 20:06:42serhiy.storchakacreate