Changes between Version 1 and Version 2 of Ticket #25393, comment 27


Ignore:
Timestamp:
09/09/18 15:54:56 (3 years ago)
Author:
egourgoulhon
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25393, comment 27

    v1 v2  
    44Indeed `ContinuousMap.__hash__` and `Map.__hash__` are essentially identical, but I guess the logic of removing `Morphism.__hash__` applies to `Map.__hash__` as well. From the ticket description: ''As far as I can tell there is no code using the ability to hash Morphisms, and having this in the base class is misleading since there are subclasses which are not immutable and should not be hashable anyways. It would be better to implement __hash__ on an as-needed basis for those classes that can guarantee immutability.'' If only `Morphism.__hash__` is removed and `Map.__hash__` is kept, then all subclasses will still have some `__hash__` inherited from their base class (`Map`) and therefore will look hashable to Python3, even if they are not immutable, which is truly dangerous...
    55
    6 PS: I realize that the removing of `Map.__hash__` was already advocated by Travis for the very same reasons in comment:19.
     6PS: I realize that the removing of `Map.__hash__` was already advocated by Travis for the very same reasons in comment:19. See also comment:21 for the consequences of the removal of `Map.__hash__` (only 2 failed doctests).