Is it wise to use the object id as a hash key (via. the __hash__) to be able to hash an otherwise mutable object for a single instance of a program? Using the object attributes would be nicer but they’re all mutable and can change.
This occurred to me while looking at Sets of instances and I’m wondering if it’s wise.
Yes, as long as you also define
__eq__(and presumably__ne__!-) consistently with that. IOW, it’s fine, as long as you’re fine witha==bmeaning exactly the same asa is b!-)