[Ref / Label] make equality safe for unrelated types
This commit is contained in:
parent
20c845a881
commit
2e0b64bdab
4 changed files with 16 additions and 0 deletions
|
|
@ -78,6 +78,8 @@ class Label(PositionableImpl, RepeatableImpl, AnnotatableImpl, Bounded, Pivotabl
|
|||
return annotations_lt(self.annotations, other.annotations)
|
||||
|
||||
def __eq__(self, other: Any) -> bool:
|
||||
if type(self) is not type(other):
|
||||
return False
|
||||
return (
|
||||
self.string == other.string
|
||||
and numpy.array_equal(self.offset, other.offset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue