@@ -403,7 +403,7 @@ def __init__(self, parent, polys, check=True):
403
403
genus = C .genus ()
404
404
if a .degree () > genus :
405
405
polys = cantor_reduction (a , b , f , h , genus )
406
- self .__polys = polys
406
+ self .__polys = tuple ( polys )
407
407
408
408
def _printing_polys (self ):
409
409
r"""
@@ -633,7 +633,7 @@ def __tuple__(self):
633
633
sage: tuple(P) # indirect doctest # needs sage.rings.number_field
634
634
(x - 1, -a)
635
635
"""
636
- return tuple ( self .__polys )
636
+ return self .__polys
637
637
638
638
def __getitem__ (self , n ):
639
639
r"""
@@ -662,9 +662,9 @@ def __getitem__(self, n):
662
662
sage: P[-1] # indirect doctest
663
663
-a
664
664
sage: P[:1] # indirect doctest
665
- [ x - 1]
665
+ ( x - 1,)
666
666
"""
667
- return list ( self .__polys ) [n ]
667
+ return self .__polys [n ]
668
668
669
669
def _richcmp_ (self , other , op ):
670
670
r"""
@@ -724,6 +724,9 @@ def _richcmp_(self, other, op):
724
724
# comparing polynomials is well-defined
725
725
return richcmp (self .__polys , other .__polys , op )
726
726
727
+ def __hash__ (self ):
728
+ return hash (self .__polys )
729
+
727
730
def __bool__ (self ):
728
731
r"""
729
732
Return ``True`` if this divisor is not the additive identity element.
0 commit comments