@@ -48,7 +48,7 @@ def __hash__(self) -> int:
48
48
return hash (self .document_id )
49
49
50
50
def __eq__ (self , other ) -> bool :
51
- return isinstance (other , DocumentPath ) and self .document_id == other .document_id
51
+ return isinstance (other , type ( self ) ) and self .document_id == other .document_id
52
52
53
53
def __str__ (self ) -> str :
54
54
return DocumentPath .to_api_path (self )
@@ -107,11 +107,11 @@ def copy(cls, instance: InstancePath) -> InstancePath:
107
107
return cls (instance .document_id , instance .instance_id , instance .instance_type )
108
108
109
109
def __hash__ (self ) -> int :
110
- return super ().__hash__ () ^ hash ( self .instance_id ) ^ hash ( self .wvm )
110
+ return hash (( super ().__hash__ (), self .instance_id , self .wvm ) )
111
111
112
112
def __eq__ (self , other ) -> bool :
113
113
return (
114
- isinstance (other , InstancePath )
114
+ isinstance (other , type ( self ) )
115
115
and super ().__eq__ (other )
116
116
and self .instance_id == other .instance_id
117
117
and self .wvm == other .wvm
@@ -163,11 +163,11 @@ def copy(cls, element: ElementPath) -> ElementPath:
163
163
)
164
164
165
165
def __hash__ (self ) -> int :
166
- return super ().__hash__ () ^ hash ( self .element_id )
166
+ return hash (( super ().__hash__ (), self .element_id ) )
167
167
168
168
def __eq__ (self , other ) -> bool :
169
169
return (
170
- isinstance (other , ElementPath )
170
+ isinstance (other , type ( self ) )
171
171
and self .__eq__ (other )
172
172
and self .element_id == other .element_id
173
173
)
@@ -217,11 +217,11 @@ def from_path(cls, element: ElementPath, part_id: str) -> PartPath:
217
217
)
218
218
219
219
def __hash__ (self ) -> int :
220
- return super ().__hash__ () ^ hash ( self .part_id )
220
+ return hash (( super ().__hash__ (), self .part_id ) )
221
221
222
222
def __eq__ (self , other ) -> bool :
223
223
return (
224
- isinstance (other , PartPath )
224
+ isinstance (other , type ( self ) )
225
225
and self .__eq__ (other )
226
226
and self .part_id == other .part_id
227
227
)
0 commit comments