From c9e894879f840d5717e6a2aaa270fe0ee8d28c58 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 29 Jul 2024 03:53:23 -0700 Subject: [PATCH] use "is" over == for types --- fatamorgana/basic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fatamorgana/basic.py b/fatamorgana/basic.py index 57b3919..1f11bb3 100644 --- a/fatamorgana/basic.py +++ b/fatamorgana/basic.py @@ -1735,7 +1735,7 @@ class PropStringReference: self.ref_type = ref_type def __eq__(self, other: Any) -> bool: - return isinstance(other, type(self)) and self.ref == other.ref and self.reference_type == other.reference_type + return isinstance(other, type(self)) and self.ref == other.ref and self.reference_type is other.reference_type def __repr__(self) -> str: return f'[{self.ref_type} : {self.ref}]' @@ -1843,11 +1843,11 @@ def write_property_value( size = write_uint(stream, 12) size += value.write(stream) elif isinstance(value, PropStringReference): - if value.ref_type == AString: + if value.ref_type is AString: size = write_uint(stream, 13) - elif value.ref_type == bytes: + elif value.ref_type is bytes: size = write_uint(stream, 14) - if value.ref_type == AString: + if value.ref_type is AString: size = write_uint(stream, 15) size += write_uint(stream, value.ref) else: