forked from jan/fatamorgana
use "is" over == for types
This commit is contained in:
parent
d83ef1ce2d
commit
c9e894879f
@ -1735,7 +1735,7 @@ class PropStringReference:
|
|||||||
self.ref_type = ref_type
|
self.ref_type = ref_type
|
||||||
|
|
||||||
def __eq__(self, other: Any) -> bool:
|
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:
|
def __repr__(self) -> str:
|
||||||
return f'[{self.ref_type} : {self.ref}]'
|
return f'[{self.ref_type} : {self.ref}]'
|
||||||
@ -1843,11 +1843,11 @@ def write_property_value(
|
|||||||
size = write_uint(stream, 12)
|
size = write_uint(stream, 12)
|
||||||
size += value.write(stream)
|
size += value.write(stream)
|
||||||
elif isinstance(value, PropStringReference):
|
elif isinstance(value, PropStringReference):
|
||||||
if value.ref_type == AString:
|
if value.ref_type is AString:
|
||||||
size = write_uint(stream, 13)
|
size = write_uint(stream, 13)
|
||||||
elif value.ref_type == bytes:
|
elif value.ref_type is bytes:
|
||||||
size = write_uint(stream, 14)
|
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, 15)
|
||||||
size += write_uint(stream, value.ref)
|
size += write_uint(stream, value.ref)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user