Ticket #3724: m4ri_hash2.patch

File m4ri_hash2.patch, 1.0 kB (added by malb, 4 months ago)

address review

  • a/sage/matrix/matrix_mod2_dense.pyx

    old new  
    287287 
    288288        TEST: 
    289289            sage: A = matrix(GF(2),2,0) 
     290            sage: hash(A) 
     291            Traceback (most recent call last): 
     292            ... 
     293            TypeError: mutable matrices are unhashable 
    290294            sage: A.set_immutable() 
    291295            sage: hash(A) 
    292296            0 
     297             
    293298        """ 
     299        if self.is_mutable(): 
     300            raise TypeError("mutable matrices are unhashable") 
    294301        cdef unsigned long _hash = 0xDEADBEEF 
    295302        cdef unsigned long counter = 0 
    296303        cdef unsigned long i, j, truerow