From 2fb09d254d935fcf4386f585934dcc06900bcb40 Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Tue, 30 Mar 2021 23:59:56 +0100 Subject: [PATCH] Fixed py/missing-equals alert in LGTM. See https://lgtm.com/rules/9990086/ for details. --- soapfish/xsd.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/soapfish/xsd.py b/soapfish/xsd.py index c1904e1..b019782 100644 --- a/soapfish/xsd.py +++ b/soapfish/xsd.py @@ -765,6 +765,11 @@ def append(self, value): raise ValueError(f'You must not add more than {self._list._maxOccurs} items to this list.') super().append(accepted_value) + def __eq__(self, other): + if not isinstance(other, TypedList): + return False + return self._list == other._list and super().__eq__(other) + class ListElement(Element): """ @@ -1195,3 +1200,8 @@ class NamedType(ComplexType): def __init__(self, name=None, value=None): self.name = name self.value = value + + def __eq__(self, other): + if not isinstance(other, NamedType): + return False + return self.name == other.name and self.value == other.value and super().__eq__(other)