From f09fde100842275b7fff224db16f44ccd186a292 Mon Sep 17 00:00:00 2001 From: Martin Vilcans Date: Thu, 9 Nov 2023 12:32:15 +0100 Subject: Compare types with isinstance - gets rid of warning --- screenplain/richstring.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenplain/richstring.py b/screenplain/richstring.py index 8a11fec..74098a2 100644 --- a/screenplain/richstring.py +++ b/screenplain/richstring.py @@ -70,13 +70,13 @@ class RichString(object): def __eq__(self, other): return ( - type(self) == type(other) and + isinstance(other, RichString) and self.segments == other.segments ) def __ne__(self, other): return ( - type(self) != type(other) or + isinstance(other, RichString) and self.segments != other.segments ) -- cgit