On Tue, Dec 22, 2020 at 5:59 AM David Mertz
On Mon, Dec 21, 2020 at 6:32 PM Chris Angelico
wrote: But the real question is: Why do points compare equal based on their locations, if you need them to be independently stored in a set? Logically, if they are equal, the set either contains that one thing or it doesn't.
This is a 3 minute example, not a fleshed out application design. The intuition I was going for was that various places might be located at e.g. lat/lon coordinates. But some are in the same building, hence equal address. Using `==` as a way of comparing being in the same place could be useful. Yes, I can also think of other ways of designing this (e.g. `p1.sameAddress(p2)`). My goal here was showing plausibility, not proposing a specific software design for a given need.
Yeah, fair enough. But I asked it that way because figuring out an answer to that question (which requires knowledge of the actual use-case) would immediately answer the question of how to handle hashing. ChrisA