mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #23326: Removed __ne__ implementations. Since fixing default __ne__
implementation in issue #21408 they are redundant.
This commit is contained in:
parent
57f7db3122
commit
08448a1f4d
20 changed files with 3 additions and 104 deletions
|
@ -567,12 +567,6 @@ class timedelta:
|
|||
else:
|
||||
return False
|
||||
|
||||
def __ne__(self, other):
|
||||
if isinstance(other, timedelta):
|
||||
return self._cmp(other) != 0
|
||||
else:
|
||||
return True
|
||||
|
||||
def __le__(self, other):
|
||||
if isinstance(other, timedelta):
|
||||
return self._cmp(other) <= 0
|
||||
|
@ -804,11 +798,6 @@ class date:
|
|||
return self._cmp(other) == 0
|
||||
return NotImplemented
|
||||
|
||||
def __ne__(self, other):
|
||||
if isinstance(other, date):
|
||||
return self._cmp(other) != 0
|
||||
return NotImplemented
|
||||
|
||||
def __le__(self, other):
|
||||
if isinstance(other, date):
|
||||
return self._cmp(other) <= 0
|
||||
|
@ -1079,12 +1068,6 @@ class time:
|
|||
else:
|
||||
return False
|
||||
|
||||
def __ne__(self, other):
|
||||
if isinstance(other, time):
|
||||
return self._cmp(other, allow_mixed=True) != 0
|
||||
else:
|
||||
return True
|
||||
|
||||
def __le__(self, other):
|
||||
if isinstance(other, time):
|
||||
return self._cmp(other) <= 0
|
||||
|
@ -1651,14 +1634,6 @@ class datetime(date):
|
|||
else:
|
||||
return False
|
||||
|
||||
def __ne__(self, other):
|
||||
if isinstance(other, datetime):
|
||||
return self._cmp(other, allow_mixed=True) != 0
|
||||
elif not isinstance(other, date):
|
||||
return NotImplemented
|
||||
else:
|
||||
return True
|
||||
|
||||
def __le__(self, other):
|
||||
if isinstance(other, datetime):
|
||||
return self._cmp(other) <= 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue