#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            |  a354f9eef48bb882a538d53dc06e416e9fc8393c
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by emassop):

 Replying to [comment:30 jdemeyer]:
 > Replying to [comment:28 emassop]:
 > > The docstring says "This is cached, so we can manually set the result
 if required".
 > Fixed.

 Yeah, this works :).

 > > Why is it okay to change `gens_dict`, but not `gens` itself?
 > Because of the way how `gens_dict()` is used: `gens_dict` is supposed to
 return a dict of generators with their name as key. For example, it is
 often used to name variables for an `eval()` statement. So philosophically
 this is closer to `_defining_generators()` than to `gens()`.

 Reading `gens_dict` as a dict version of `gens`, I would expect the same
 values to be present in `gens_dict` as in `gens`. However, with `gens`
 deprecated, maybe this is okay.

 > > Hack: What about reordering the result of `gens()` (or probably
 `basis`?) such that desired generators form a prefix?
 > I would guess that would break stuff. I wouldn't be surprised if there
 was code assuming that `1` is the first element of `basis()`.

 Yeah, that seems likely :(. We can use such a trick to fix `R.<several
 letters> =` though, by  prepending `[x for x in self.number_field().gens()
 if x in self]` to `remaining` in `.ring_generators`. I don't like it very
 much, but I think it could work.

--
Ticket URL: <http://trac.sagemath.org/ticket/15348#comment:31>
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.

Reply via email to