From 7527287142722d6adbc0c65b99cb1d24f7f3a263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garc=C3=ADa=20M=C3=A9ndez?= <44614728+egarciamendez@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:08:56 +0100 Subject: [PATCH] check for same class --- blueprints/codes/eurocode/exposure_classes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprints/codes/eurocode/exposure_classes.py b/blueprints/codes/eurocode/exposure_classes.py index b87be5bb..934f4f4d 100644 --- a/blueprints/codes/eurocode/exposure_classes.py +++ b/blueprints/codes/eurocode/exposure_classes.py @@ -42,7 +42,7 @@ def __eq__(self, other: object) -> bool: Boolean True if both arguments are of the same severity (In this case they will both be literally the same). """ - if not isinstance(other, Exposure): + if not isinstance(other, self.__class__): raise TypeError("Only the same exposure class types can be compared with each other!") _self_severity = int(self.value[-1]) if self.value != "Not applicable" else 0 _other_severity = int(other.value[-1]) if other.value != "Not applicable" else 0