On Tue, Dec 22, 2020 at 5:59 AM David Mertz <me...@gnosis.cx> wrote: > > On Mon, Dec 21, 2020 at 6:32 PM Chris Angelico <ros...@gmail.com> 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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/VPWEUO5PQHD2M2RICEGMBZRUJ5NBPXTP/ Code of Conduct: http://python.org/psf/codeofconduct/