Fix several typing issues

Contributes to issue CURA-8587.
This commit is contained in:
Ghostkeeper 2021-12-06 17:22:07 +01:00
parent e525770332
commit aec643fd44
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 8 additions and 5 deletions

View file

@ -71,11 +71,13 @@ class PackageModel(QObject):
self.sdk_version = package_data.get("sdk_version_semver", "")
# Note that there's a lot more info in the package_data than just these specified here.
def __eq__(self, other: Union[str, "PackageModel"]):
def __eq__(self, other: object):
if isinstance(other, PackageModel):
return other == self
else:
elif isinstance(other, str):
return other == self._package_id
else:
return False
def __repr__(self):
return f"<{self._package_id} : {self._package_version} : {self._section_title}>"