Message261385
I propose to change __ne__ of `object` in the following form:
class NewObject(object):
def __ne__(self, other):
return not self.__eq__(other)
Currently overwriting the `__eq__` method requires also overwriting `__ne__`. In a vast majority of cases this results in some boilerplate code as:
(a == b) ^ (a != b) == True
to reduce surprises. Changing the default behavior still allows for the limited number of use cases where we want to implement __ne__ differently.
In short I propose the same behavior than __str__ and __repr__ have for __eq__ and __ne__.
(https://docs.python.org/3/reference/datamodel.html#object.__str__) |
|
Date |
User |
Action |
Args |
2016-03-08 21:55:55 | magu | set | recipients:
+ magu |
2016-03-08 21:55:55 | magu | set | messageid: <1457474155.28.0.06785872232.issue26514@psf.upfronthosting.co.za> |
2016-03-08 21:55:55 | magu | link | issue26514 messages |
2016-03-08 21:55:54 | magu | create | |
|