#9016: make morphisms hashable
---------------------------------+------------------------------------------
Reporter: burcin | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.6
Component: categories | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Robert Bradshaw, Travis
Scrimshaw
Authors: Burcin Erocal | Merged in:
Dependencies: | Stopgaps:
---------------------------------+------------------------------------------
Comment (by tscrim):
For the most part, I would almost argue against doing that, in particular,
it does not make sure that hash values do not change in different sage
sessions and machines (since the tests are run multiple times generally).
For example, say we create an object `O` and use it as a key it in a
dictionary `D` (e.g. `D[O] = 5`) and then pickle `D`. Then on another
session/machine (with the same bit architecture) we unpickle `D` and to do
`D[O]` safely; we want to make sure via doctests that the hashes match.
Actually on that note, I wonder if we need to (much less how) send a
warning to the users when hash values change from one version to another.
In that context, I would argue that these tests are how we should do
everything and never update a hash value unless the structure of a class
changes. Granted, I am making an assumption about python pickles
dictionaries: that python does not recreate the object then reinsert it
into the hash table but instead creates the object in the desired
location. I have a test in mind that I will run tonight. I hope all of the
above makes sense.
However I do see your point since the underlying hash values can change
and makes the doctests of certain classes harder to maintain. Also I do
somewhat like the `hash(phi) == hash(phi)` test since the hash is run
multiple times and it checks to make sure the object is hashable.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9016#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.