# HG changeset patch
# User William Stein <wstein@gmail.com>
# Date 1263906157 28800
# Node ID 9cb51a984397cf36a609e7eb615e581f35cf7461
# Parent 47169dc430e653bafdec63f2bd7a5884d27afe7b
trac 7516  bug in pickling quotient module over pid
diff r 47169dc430e6 r 9cb51a984397 sage/modules/free_module.py
a

b


4589  4589  3713095619189944444 # 64bit 
4590  4590  sage: U is V 
4591  4591  True 
4592   """ 
4593   return hash(self.__basis) 
 4592  
 4593  TESTS:: 
 4594  
 4595  We verify that trac 7516 is fixed, which involves unpickling 
 4596  an object failing due to hash being called during the 
 4597  unpickle:: 
 4598  
 4599  sage: V = VectorSpace(QQ, 2) 
 4600  sage: W = V.subspace([V([1,1])]) 
 4601  sage: Z = W.subspace([]) 
 4602  sage: WmodZ = W / Z 
 4603  sage: WmodZ(W(0)) 
 4604  (0) 
 4605  sage: loads(dumps(WmodZ)) == WmodZ 
 4606  True 
 4607  """ 
 4608  try: 
 4609  return hash(self.__basis) 
 4610  except AttributeError: 
 4611  # This is a fallback because sometimes hash is called during object 
 4612  # reconstruction (unpickle), and the above fields haven't been 
 4613  # filled in yet. 
 4614  return 0 
4594  4615  
4595  4616  def construction(self): 
4596  4617  """ 