From efe5dc8d538f0945bead5514cd6135816a2b3b6f Mon Sep 17 00:00:00 2001 From: Nikos Koukis Date: Wed, 24 Jan 2024 16:39:40 +0200 Subject: [PATCH] Fix linter warning re __eq__ not returning on all paths --- uri/scheme.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uri/scheme.py b/uri/scheme.py index 0d225cf..dec1c47 100644 --- a/uri/scheme.py +++ b/uri/scheme.py @@ -16,6 +16,8 @@ def __eq__(self, other: "SchemeLike"): if isinstance(other, self.__class__): return self is other + raise RuntimeError(f"Cannot compare objects - incompatible types, " f"self: {type(self)}, other: {type(other)}") + def __hash__(self) -> int: return hash(self.name)