We have discussed this before. I remember writing a few examples where it brakes 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. It used to be implemented in the past, but as a result of our discussion it was removed. Vitalije On Tuesday, October 15, 2019 at 12:58:26 PM UTC+2, Edward K. Ream wrote: > > #1394 <https://github.com/leo-editor/leo-editor/issues/1394> suggests > making positions hashable. The "hash" branch enables hashing and all seems > well. > > There is evidence (including a unit test) that disabling hashing for > positions was done on purpose. > > Can anyone tell me why hashing positions is a bad idea? > > 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/5bee715a-82b4-48ef-b991-e69c45109497%40googlegroups.com.
