Marchowes / pyProm

Surface Network Analyzer.
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

re-evaluate all __hash__ functions for insertion issues #153

Open Marchowes opened 4 years ago

Marchowes commented 4 years ago

Problem:

if an object is being inserted in a set, and hash is using mutable values, we get really scary insertion errors.

Example:

class whatever: ..self.points...

def hash(): return(tuple(self.points))

Now if we are adding whatever objects to a set, and we add a point, the hash will change, and the set will think it is a different object. This is problematic.