#20246: Use `with strict_equality(True)` to work around hashing of p-adics
-------------------------------------+-------------------------------------
Reporter: saraedum | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-7.2
Component: padics | Resolution:
Keywords: days71 | Merged in:
Authors: Julian RĂ¼th | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/saraedum/use__with_strict_equality_true___to_work_around_hashing_of_p_adics|
f4c5a9db729ccf911517039fdced282588210133
Dependencies: #16342, #16339 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
I don't know which callbacks there are exactly in sage. However, for me
it's really an interface design issue. p-adic numbers are very useful and
I think we should be able to model them using normal python objects.
Introducing `strictequality` state would depart from that.
As an example, we'd end up with objects that somehow can be stuck into a
dictionary but then don't behave as one would expect. We'd end up with
dictionaries for which things like
{{{
all(d in D for d in D)
}}}
doesn't hold. That is unnecessarily complicating the language.
We'd furthermore have objects that we can stick into a data structure
supplied by the standard library (`weakref.WeakValueDictionary`) but don't
behave properly in it.
It's not just a matter of what is in sage now. It's about ensuring that we
make sure that the objects we create in sage are relatively easy to reason
about. Making equality depend on global state is a serious departure from
that. I'm sure that p-adic numbers aren't special enough to warrant such a
complication. Either we have an equality concept that's compatible with
hashing and p-adic numbers are hashable, or we have an equality concept
that's not, and then p-adics are not hashable. A hybrid model causes
problems in python, as illustrated.
--
Ticket URL: <http://trac.sagemath.org/ticket/20246#comment:34>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.