mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Remove unnecessary __ne__ definitions
In Python 3, __ne__ defaults to the inverse of __eq__. From https://docs.python.org/3/reference/datamodel.html#object.__ne__ > By default, __ne__() delegates to __eq__() and inverts the result > unless it is NotImplemented.
This commit is contained in:
parent
ff8df59ac1
commit
cfd5ac06c0
@ -208,10 +208,6 @@ class BuildInfo:
|
|||||||
return (self.config_hash == other.config_hash and
|
return (self.config_hash == other.config_hash and
|
||||||
self.tags_hash == other.tags_hash)
|
self.tags_hash == other.tags_hash)
|
||||||
|
|
||||||
def __ne__(self, other): # type: ignore
|
|
||||||
# type: (BuildInfo) -> bool
|
|
||||||
return not (self == other) # for py27
|
|
||||||
|
|
||||||
def dump(self, f):
|
def dump(self, f):
|
||||||
# type: (IO) -> None
|
# type: (IO) -> None
|
||||||
f.write('# Sphinx build info version 1\n'
|
f.write('# Sphinx build info version 1\n'
|
||||||
|
@ -611,10 +611,6 @@ class ASTBase(UnicodeMixin):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def __ne__(self, other):
|
|
||||||
# type: (Any) -> bool
|
|
||||||
return not self.__eq__(other)
|
|
||||||
|
|
||||||
__hash__ = None # type: Callable[[], int]
|
__hash__ = None # type: Callable[[], int]
|
||||||
|
|
||||||
def clone(self):
|
def clone(self):
|
||||||
|
@ -138,10 +138,6 @@ class _TranslationProxy(UserString):
|
|||||||
# type: (Any) -> bool
|
# type: (Any) -> bool
|
||||||
return self.data == other
|
return self.data == other
|
||||||
|
|
||||||
def __ne__(self, other):
|
|
||||||
# type: (Any) -> bool
|
|
||||||
return self.data != other
|
|
||||||
|
|
||||||
def __gt__(self, other):
|
def __gt__(self, other):
|
||||||
# type: (unicode) -> bool
|
# type: (unicode) -> bool
|
||||||
return self.data > other
|
return self.data > other
|
||||||
|
@ -128,10 +128,6 @@ class Token:
|
|||||||
else:
|
else:
|
||||||
raise ValueError('Unknown value: %r' % other)
|
raise ValueError('Unknown value: %r' % other)
|
||||||
|
|
||||||
def __ne__(self, other):
|
|
||||||
# type: (Any) -> bool
|
|
||||||
return not (self == other)
|
|
||||||
|
|
||||||
def match(self, *conditions):
|
def match(self, *conditions):
|
||||||
# type: (Any) -> bool
|
# type: (Any) -> bool
|
||||||
return any(self == candidate for candidate in conditions)
|
return any(self == candidate for candidate in conditions)
|
||||||
|
Loading…
Reference in New Issue
Block a user