On Tue, Oct 15, 2019 at 6:10 AM vitalije <[email protected]> wrote:
> We have discussed this before. I remember writing a few examples where it > breaks user expectations. From the Python documentation about > object.__hash__ method: > > If a class defines mutable objects and implements an __eq__() method, it >> should not implement __hash__(), since the implementation of hashable >> collections requires that a key’s hash value is immutable (if the object’s >> hash value changes, it will be in the wrong hash bucket). >> > > Positions are mutable objects and therefore they should not implement this > method. > Thanks for this. I've added a comment in devel explaining why p.__hash__ should be None. I've also closed #1394 and marked it Won'tDo. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS1gXn7SaouJeCrrswjeaAFMKFoKjhkd%2BtPfmq%2BRLD8jTw%40mail.gmail.com.
