Closed wrohdewald closed 4 years ago
hash_object
is removed because with extensions it really makes no sense checking only object fields. And if we want it to me implemented properly -- it must also traverse all the extensions DOMs, and that's just too much trouble.
PS. I removed hash_object
and all references in dev
. So, at least the error should be gone when I merge it to master
.
current master
Trying to create a set of Location:
AttributeError: module 'gpxpy.utils' has no attribute 'hash_object'
hash_object is used in
geo.py: return mod_utils.hash_object(self, ('latitude', 'longitude', 'elevation'))
quick and dirty solution: add to utils.py:
def hash_object(obj, attributes): """Create a hash for obj""" return sum(int(getattr(obj, x)) for x in attributes)
if hash_object is never used for anything other than Location, I would instead do: (untested)
geo.py: return int(self.latitude 1000) + int(self.longitude 1000) + int(self.elevation * 10)