#14084: Wrong domain of the fraction field construction functor
------------------------------+---------------------------------------------
Reporter: SimonKing | Owner: roed
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.7
Component: padics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Simon King | Merged in:
Dependencies: | Stopgaps:
------------------------------+---------------------------------------------
Comment (by SimonKing):
I do agree that changing the category on the fly looks suspicious. The
true reason for originally implementing it in that way was speed: There
were many fields that have not been initialised as fields, but had a
method `is_field`; hence, the test `K in Fields()` used to first check the
category and then the answer of `is_field` (similar to what is done now).
Repeating this test used to be incredibly slow, which was quite visible in
some examples.
Note that this change of class and category---changing from (the parent
class of) one category to (the parent class of) the join of this category
with the category of fields---is not a regression. Actually, it fixes a
bug. Namely, in the good old times, one could very well have `P in
Fields()` return true and `P in IntegralDomains()` return false. Now, `P
in IntegralDomains()` would return true---at least when it is called after
`P in Fields()`.
If all fields would be initialised as fields right away, we could
certainly avoid this dangerous game. But the original rationale for
working with the is_field methods is still valid: Sometimes the test of
something really is a field is very expensive (primality tests, etc). So,
one should avoid the expensive test as long as possible.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14084#comment:19>
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 http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.