Serhiy Storchaka added the comment:

>>> import plistlib
>>> class MyData(bytes):
...     def __eq__(self, other):
...         if isinstance(other, plistlib.Data):
...             return super().__eq__(other.value)
...         return False
... 
>>> plistlib.Data(b'x') == MyData(b'x')
True

If use the equality operator the result is False.

I don't know if this is good example. In any case this is corner case and we 
can manage with "==".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26711>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to