diff options
| author | Martin Vilcans <martin@librador.com> | 2023-11-09 12:32:15 +0100 |
|---|---|---|
| committer | Martin Vilcans <martin@librador.com> | 2023-11-09 12:32:15 +0100 |
| commit | f09fde100842275b7fff224db16f44ccd186a292 (patch) | |
| tree | e7fa22454e589c5976d60c90b05a4c74ae87759e | |
| parent | cf056eab7f1f739852574d5e81411321f2abd4f2 (diff) | |
Compare types with isinstance - gets rid of warning
| -rw-r--r-- | screenplain/richstring.py | 4 |
1 files 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 ) |
