#15348: "R.<a> =" syntactic sugar incorrect for EquationOrder
-------------------------------------+-------------------------------------
Reporter: emassop | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.0
Component: number fields | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/15348 | b1a2b4f3b9d4d2f443cffeca1449cdbb4d00bd56
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by emassop):
Replying to [comment:23 jdemeyer]:
> Replying to [comment:22 emassop]:
> > It seems weird if the return value of `.defining_generators` changes
during an object's life. If the value gets set only once during an
object's life-time (and survives pickling), then not having this
additional complexity is okay. The proposal above is merely to enforce
that the value does not get changed accidentally.
> I don't see how the value could get changed accidentally. And like I
said: there are many cached functions in Sage, what makes this one so
special?
The docstring says "This is cached, so we can manually set the result if
required". As such, it seems intended for the cache to contain a value
that would not be the result of executing the function. (Otherwise you
would not need to set it manually.) This is against the idea of a cache as
an optimization that speeds up a function call by remembering the previous
result.
Does the
[http://git.sagemath.org/sage.git/commit/?id=af007674767ddfd652c10fb2bd79799377dc9ffb
docstring change] of `RelativeOrder.basis` affect the community's ability
to change this function's behavior? It previously seemed to me that it
could start returning a basis relative to the base order at any time.
Why is it okay to change `gens_dict`, but not `gens` itself?
Hack: What about reordering the result of `gens()` (or probably `basis`?)
such that desired generators form a prefix? Then the syntactic sugar would
work because it uses only the first `n` items.
--
Ticket URL: <http://trac.sagemath.org/ticket/15348#comment:28>
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.