Hi there,

I'm doing some cleanup in the computation of the hash value for various parent
in sage (see #8120 and followup). A technical question came up: suppose that
some object is inserted is a hash table (eg: some cache) and that the whole
table is pickled. Do we have to ensure that upon unpickling, the hash value of
the object is kept ?

Currently most parents use one of the two following methods to compute a hash
value:

 1 - take the value of the hash of _repr_. This is slow and change after a
renaming so this is not a good idea. Note that, caching the computed value can
help to solve these two issues. However if no care is taken to ensure that the
cached value is pickled, the hash value can change.

 2 - ensure unique representation and return id. Of course we cannot ensure
 that this is stable during pickle/unpickle.

Any comment or suggestion ?

Florent

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to