# HG changeset patch
# User Sebastien Labbe <slabqc at gmail.com>
# Date 1358964049 3600
# Node ID 453c1a31eb10cd7cbf1cd3023200e2b3efdc4de9
# Parent a163652b02a9d49fea0ac784aaa935159e12cc00
Fixing the hash problem for pickled Sequence
diff git a/sage/structure/sequence.py b/sage/structure/sequence.py
a

b

class Sequence_generic(sage.structure.sa 
911  911  sage: S._Sequence__universe = 'foobar' 
912  912  sage: S.universe() 
913  913  'foobar' 
 914  
 915  We test that :trac:`13998` is fixed:: 
 916  
 917  sage: S = Sequence([]) 
 918  sage: S.set_immutable() 
 919  sage: del S._Sequence_generic__hash 
 920  sage: hash(S) 
 921  Traceback (most recent call last): 
 922  ... 
 923  AttributeError: 'Sequence_generic' object has no attribute '_Sequence_generic__hash' 
 924  sage: S._Sequence__hash = 34 
 925  sage: hash(S) 
 926  34 
914  927  """ 
915  928  if name == "_Sequence_generic__cr" and hasattr(self,"_Sequence__cr"): 
916  929  self.__cr = self._Sequence__cr 
… 
… 
class Sequence_generic(sage.structure.sa 
924  937  elif name == "_Sequence_generic__universe" and hasattr(self,"_Sequence__universe"): 
925  938  self.__universe = self._Sequence__universe 
926  939  return self.__universe 
 940  elif name == "_Sequence_generic__hash" and hasattr(self,"_Sequence__hash"): 
 941  self.__hash = self._Sequence__hash 
 942  return self.__hash 
927  943  else: 
928  944  raise AttributeError("'Sequence_generic' object has no attribute '%s'"%name) 
929  945  seq = Sequence 