Skip to content

Commit 4cead93

Browse files
committed
Relax _Record.__eq__ - don't require equal oids (PyShp implementation detail, not a shapefile record property)
1 parent 25a3199 commit 4cead93

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

shapefile.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,10 @@ def __dir__(self):
855855
return default + fnames
856856

857857
def __eq__(self, other):
858-
return (
859-
isinstance(other, self.__class__)
860-
and self.__field_positions == other.__field_positions
861-
and self.oid == other.oid
862-
and len(self) == len(other)
863-
and all(val_self == val_other for val_self, val_other in izip(self, other))
864-
)
865-
858+
if isinstance(other, self.__class__):
859+
if self.__field_positions != other.__field_positions:
860+
return False
861+
return list.__eq__(self, other)
866862

867863
class ShapeRecord(object):
868864
"""A ShapeRecord object containing a shape along with its attributes.

0 commit comments

Comments
 (0)