Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions source/JABHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ def __eq__(self,jabContext):
else:
return False

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def __ne__(self,jabContext):
if self.vmID!=jabContext.vmID or not bridgeDll.isSameObject(self.vmID,self.accContext,jabContext.accContext):
return True
Expand Down
5 changes: 5 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ def __eq__(self,other):
if self.__class__ is not other.__class__: return False
return bool(self._rangeObj.compare(other._rangeObj))

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def _get_NVDAObjectAtStart(self):
e=self.UIAElementAtStart
if e:
Expand Down
5 changes: 5 additions & 0 deletions source/NVDAObjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ def __eq__(self,other):
return False
return self._isEqual(other)

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def __ne__(self,other):
"""The opposite to L{NVDAObject.__eq__}
"""
Expand Down
5 changes: 5 additions & 0 deletions source/compoundDocuments.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def __eq__(self, other):
return False
return self._start == other._start and self._startObj == other._startObj and self._end == other._end and self._endObj == other._endObj

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def __ne__(self, other):
return not self == other

Expand Down
8 changes: 8 additions & 0 deletions source/locationHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ def __eq__(self,other):
return NotImplemented
return self.x == other.x and self.y == other.y

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
def __hash__(self):
return super().__hash__()

def __ne__(self,other):
if not isinstance(other,POINT_CLASSES):
return NotImplemented
Expand Down Expand Up @@ -320,6 +324,10 @@ def __eq__(self,other):
return NotImplemented
return other.left == self.left and other.top == self.top and other.right == self.right and other.bottom == self.bottom

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
def __hash__(self):
return super().__hash__()

def __ne__(self,other):
if not isinstance(other,RECT_CLASSES):
return NotImplemented
Expand Down
5 changes: 5 additions & 0 deletions source/synthDrivers/_espeak.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ class espeak_VOICE(Structure):
def __eq__(self, other):
return isinstance(other, type(self)) and addressof(self) == addressof(other)

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

# constants that can be returned by espeak_callback
CALLBACK_CONTINUE_SYNTHESIS=0
CALLBACK_ABORT_SYNTHESIS=1
Expand Down
5 changes: 5 additions & 0 deletions source/textInfos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ def __eq__(self,other):
if isinstance(other,Bookmark) and self.infoClass==other.infoClass and self.data==other.data:
return True

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def __ne__(self,other):
return not self==other

Expand Down
10 changes: 10 additions & 0 deletions source/textInfos/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def __eq__(self,other):
else:
return False

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def __ne__(self,other):
return not self==other

Expand Down Expand Up @@ -166,6 +171,11 @@ def __eq__(self,other):
else:
return False

# As __eq__ was defined on this class, we must provide __hash__ to remain hashable.
# The default hash implementation is fine for our purposes.
def __hash__(self):
return super().__hash__()

def _get_locationText(self):
textList=[]
storyLength=self._getStoryLength() or 1
Expand Down