# HG changeset patch
# User Volker Braun <vbraun@stp.dias.ie>
# Date 1317075226 -7200
# Node ID 586b3e95fe15f83dcab64854f5300c4edaad921e
# Parent  18829af747d0b29525feb685cfd9fb611eca466b
Trac #11115: Reviewer patch

Just removed out-of-date commented-out code and typos in docstrings.

diff --git a/sage/misc/cachefunc.pyx b/sage/misc/cachefunc.pyx
--- a/sage/misc/cachefunc.pyx
+++ b/sage/misc/cachefunc.pyx
@@ -181,7 +181,7 @@
     sage: e.element_via_parent_test() is e.element_via_parent_test()
     True
 
-The other element class can only inherit a `cached_in_parent_method`, since
+The other element class can only inherit a ``cached_in_parent_method``, since
 the cache is stored in the parent. In fact, equal elements share the cache,
 even if they are of different types::
 
@@ -235,7 +235,7 @@
 
 It is a very common special case to cache a method that has no
 arguments. In that special case, the time needed to access the cache
-can be drastically reduced by using a special implmentation. The
+can be drastically reduced by using a special implementation. The
 cached method decorator automatically determines which implementation
 ought to be chosen. A typical example is
 :meth:`sage.rings.polynomial.multi_polynomial_ideal.MPolynomialIdeal.gens`
@@ -738,7 +738,9 @@
         sage: R.<x, y, z> = PolynomialRing(QQ, 3)
         sage: I = R*(x^3 + y^3 + z^3,x^4-y^4)
         sage: I.groebner_basis()
-        [y^5*z^3 - 1/4*x^2*z^6 + 1/2*x*y*z^6 + 1/4*y^2*z^6, x^2*y*z^3 - x*y^2*z^3 + 2*y^3*z^3 + z^6, x*y^3 + y^4 + x*z^3, x^3 + y^3 + z^3]
+        [y^5*z^3 - 1/4*x^2*z^6 + 1/2*x*y*z^6 + 1/4*y^2*z^6, 
+         x^2*y*z^3 - x*y^2*z^3 + 2*y^3*z^3 + z^6,
+         x*y^3 + y^4 + x*z^3, x^3 + y^3 + z^3]
         sage: I.groebner_basis
         Cached version of <function groebner_basis at 0x...>
 
@@ -1584,7 +1586,7 @@
 
     The example shows that the actual computation
     takes place only once, and that the result is
-    identic for equivalent input::
+    identical for equivalent input::
    
         sage: res = a.f(3, 2); res
         computing
diff --git a/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py b/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
--- a/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
+++ b/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
@@ -579,16 +579,6 @@
         if E!=self:
             self._Cartier_matrix_cached.clear_cache()
             M, Coeffs,g, Fq, p, E= self._Cartier_matrix_cached()
-#        A=self._Cartier_matrix_cached.get_cache()
-#        if len(A) !=0:
-#            if A.items()[-1][-1][-1]==self:
-#                M,Coeffs,g, Fq, p,E = A.items()[-1][1];
-#            else:
-#                A.clear()
-#                M, Coeffs,g, Fq, p, E= self._Cartier_matrix_cached()
-#        else:
-#            A.clear()
-#            M, Coeffs,g, Fq, p, E = self._Cartier_matrix_cached()
         return M
             
     #This where Hasse_Witt is actually computed. This is either called by E.Hasse_Witt or p_rank
@@ -665,17 +655,6 @@
             self._Cartier_matrix_cached.clear_cache()
             M, Coeffs,g, Fq, p, E= self._Cartier_matrix_cached()
 
-#        A=self._Cartier_matrix_cached.get_cache()
-#        if len(A) !=0:
-#            if A.items()[-1][-1][-1]==self:
-#                M,Coeffs,g, Fq, p,E = A.items()[-1][1];
-#            else:
-#                A.clear()
-#                M, Coeffs,g, Fq, p, E= self._Cartier_matrix_cached()
-#        else:
-#            A.clear()
-#            M, Coeffs,g, Fq, p, E = self._Cartier_matrix_cached()
-        
         #This compute the action of p^kth Frobenius  on list of coefficients       
         def frob_mat(Coeffs, k):
             a = p**k
@@ -686,8 +665,6 @@
                 mat.append(H);
             return matrix(Fq,mat)
     
-        
-    
         #Computes all the different possible action of frobenius on matrix M and stores in list Mall       
         Mall = [M] + [frob_mat(Coeffs,k) for k in range(1,g)]
         
@@ -759,17 +736,6 @@
             self._Hasse_Witt_cached.clear_cache()
             N, E= self._Hasse_Witt_cached()
         return N
-#        A=self._Hasse_Witt_cached.get_cache()
-#        if len(A) !=0:
-#            if A.items()[-1][-1][-1]==self:
-#                N, E = A.items()[-1][1];
-#            else:
-#                A.clear()
-#                N, E= self._Hasse_Witt_cached()
-#        else:
-#            A.clear()
-#            N, E= self._Hasse_Witt_cached()
-#        return N
 
     def a_number(self):
         r"""
@@ -810,17 +776,6 @@
         # Since Trac Ticket #11115, there is a special cache for methods
         # that don't accept arguments. The easiest is: Call the cached
         # method, and test whether the last entry is self.
-
-#        A=self._Cartier_matrix_cached.get_cache()
-#        if len(A) !=0:
-#            if A.items()[-1][-1][-1]==self:
-#                M,Coeffs,g, Fq, p,E = A.items()[-1][1];
-#            else:
-#                A.clear()
-#                M,Coeffs,g, Fq, p,E= self._Cartier_matrix_cached()
-#        else:
-#            A.clear()
-#            M,Coeffs,g, Fq, p,E= self._Cartier_matrix_cached()
         M,Coeffs,g, Fq, p,E= self._Cartier_matrix_cached()
         if E != self:
             self._Cartier_matrix_cached.clear_cache()
@@ -855,10 +810,6 @@
             sage: E=HyperellipticCurve(x^29+1,0)
             sage: E.p_rank()
             0
-
-
-
-      
         """
         #We use caching here since Hasse Witt is needed to compute p_rank. So if the Hasse Witt 
         #is already computed it is stored in list A. If it was not cached (i.e. A is empty), we simply
@@ -867,21 +818,10 @@
         #the last entry in A. If it does not match, clear A and compute Hasse Witt.
         # However, it seems a waste of time to manually analyse the cache
         # -- See Trac Ticket #11115
-
         N,E= self._Hasse_Witt_cached()
         if E!=self:
             self._Hasse_Witt_cached.clear_cache()
             N,E= self._Hasse_Witt_cached()
-#        A=self._Hasse_Witt_cached.get_cache()
-#        if len(A) !=0:
-#            if A.items()[-1][-1][-1]==self:
-#                N,E = A.items()[-1][1];
-#            else:
-#                A.clear()
-#                N,E= self._Hasse_Witt_cached()
-#        else:
-#            A.clear()
-#            N,E= self._Hasse_Witt_cached()
         pr=rank(N);
         return pr
         
