Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 1a99057

Browse files
committed
remove unused and potentially misleading __hash__ implementation for Morphisms
1 parent b4a14f9 commit 1a99057

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/sage/categories/morphism.pyx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -298,31 +298,6 @@ cdef class Morphism(Map):
298298
"""
299299
self._codomain.register_conversion(self)
300300

301-
def __hash__(self):
302-
"""
303-
Return a hash of this morphism.
304-
305-
It is the hash of the triple (domain, codomain, definition)
306-
where ``definition`` is:
307-
308-
- a tuple consisting of the images of the generators
309-
of the domain if domain has generators
310-
311-
- the string representation of this morphism otherwise
312-
313-
AUTHOR:
314-
315-
- Xavier Caruso (2012-07-09)
316-
"""
317-
domain = self.domain()
318-
codomain = self.codomain()
319-
try:
320-
gens = domain.gens()
321-
definition = tuple([self(x) for x in gens])
322-
except (AttributeError, NotImplementedError):
323-
definition = repr(self)
324-
return hash((domain, codomain, definition))
325-
326301
cpdef _richcmp_(self, other, int op):
327302
"""
328303
Generic comparison function for morphisms.

0 commit comments

Comments
 (0)