Permalink
Browse files

Refs #23919 -- Removed obsolete __ne__() methods.

__ne__() defaults to the opposite of __eq__() on Python 3
when it doesn't return NotImplemented.
  • Loading branch information...
aaugustin authored and timgraham committed Jan 18, 2017
1 parent 3cc5f01 commit eb422e476f3c0070dbf200bd62d97d12150c6fd9
@@ -391,9 +391,6 @@ def __str__(self):
def __eq__(self, other):
return isinstance(other, self.__class__)
- def __ne__(self, other):
- return not self.__eq__(other)
-
def __hash__(self):
return 1 # instances always return the same hash value
@@ -179,10 +179,6 @@ def __eq__(self, other):
else:
return False
- def __ne__(self, other):
- "Tests for inequality."
- return not (self == other)
-
def __str__(self):
"WKT is used for the string representation."
return self.wkt
@@ -68,9 +68,6 @@ def __eq__(self, other):
else:
return False
- def __ne__(self, other):
- return not (self == other)
-
@property
def name(self):
"Returns a short-hand string form of the OGR Geometry type."
@@ -177,10 +177,6 @@ def __eq__(self, other):
else:
return False
- def __ne__(self, other):
- "The not equals operator."
- return not (self == other)
-
# ### Geometry set-like operations ###
# Thanks to Sean Gillies for inspiration:
# http://lists.gispython.org/pipermail/community/2007-July/001034.html
@@ -66,9 +66,6 @@ def __eq__(self, other):
self.strict == other.strict
)
- def __ne__(self, other):
- return not (self == other)
-
class RangeMaxValueValidator(MaxValueValidator):
def compare(self, a, b):
@@ -110,9 +110,6 @@ def __contains__(self, key):
def __eq__(self, other):
return caches[DEFAULT_CACHE_ALIAS] == other
- def __ne__(self, other):
- return caches[DEFAULT_CACHE_ALIAS] != other
-
cache = DefaultCacheProxy()
@@ -25,9 +25,6 @@ def __eq__(self, other):
for attr in ['level', 'msg', 'hint', 'obj', 'id'])
)
- def __ne__(self, other):
- return not (self == other)
-
def __str__(self):
from django.db import models
@@ -68,9 +68,6 @@ def __eq__(self, other):
(self.inverse_match == other.inverse_match)
)
- def __ne__(self, other):
- return not (self == other)
-
@deconstructible
class URLValidator(RegexValidator):
View
@@ -41,9 +41,6 @@ def __delattr__(self, name):
def __eq__(self, other):
return connections[DEFAULT_DB_ALIAS] == other
- def __ne__(self, other):
- return connections[DEFAULT_DB_ALIAS] != other
-
connection = DefaultConnectionProxy()
@@ -62,9 +62,6 @@ def __eq__(self, other):
return False
return (self.name == other.name) and (self.app_label == other.app_label)
- def __ne__(self, other):
- return not (self == other)
-
def __repr__(self):
return "<Migration %s.%s>" % (self.app_label, self.name)
@@ -233,9 +233,6 @@ def __eq__(self, other):
return False
return all(model == other.models[key] for key, model in self.models.items())
- def __ne__(self, other):
- return not (self == other)
-
class AppConfigStub(AppConfig):
"""
@@ -626,6 +623,3 @@ def __eq__(self, other):
(self.bases == other.bases) and
(self.managers == other.managers)
)
-
- def __ne__(self, other):
- return not (self == other)
View
@@ -520,9 +520,6 @@ def __eq__(self, other):
return self is other
return my_pk == other._get_pk_val()
- def __ne__(self, other):
- return not self.__eq__(other)
-
def __hash__(self):
if self._get_pk_val() is None:
raise TypeError("Model instances without primary key value are unhashable")
@@ -28,9 +28,6 @@ def __eq__(self, other):
return self.name == other.name
return self.name == other
- def __ne__(self, other):
- return not self.__eq__(other)
-
def __hash__(self):
return hash(self.name)
@@ -117,6 +117,3 @@ def __repr__(self):
def __eq__(self, other):
return (self.__class__ == other.__class__) and (self.deconstruct() == other.deconstruct())
-
- def __ne__(self, other):
- return not (self == other)
@@ -160,9 +160,6 @@ def __eq__(self, other):
self._constructor_args == other._constructor_args
)
- def __ne__(self, other):
- return not (self == other)
-
def __hash__(self):
return id(self)
View
@@ -133,9 +133,6 @@ def __contains__(self, item):
def __eq__(self, other):
return list(self) == other
- def __ne__(self, other):
- return list(self) != other
-
def __getitem__(self, i):
error = self.data[i]
if isinstance(error, ValidationError):
View
@@ -140,9 +140,6 @@ def __eq__(self, other):
self.loader == other.loader
)
- def __ne__(self, other):
- return not self.__eq__(other)
-
@property
def loader_name(self):
if self.loader:
View
@@ -81,9 +81,6 @@ def __eq__(self, element):
def __hash__(self):
return hash((self.name,) + tuple(a for a in self.attributes))
- def __ne__(self, element):
- return not self.__eq__(element)
-
def _count(self, element, count=True):
if not isinstance(element, str):
if self == element:
@@ -126,11 +126,6 @@ def __str__(self):
# a __str__() method from the proxied class.
return str(self.__cast())
- def __ne__(self, other):
- if isinstance(other, Promise):
- other = other.__cast()
- return self.__cast() != other
-
def __eq__(self, other):
if isinstance(other, Promise):
other = other.__cast()

0 comments on commit eb422e4

Please sign in to comment.