I'm not sure what the right plan for variables is, but if you're rewriting polynomial printing, take a look at sage/rings/padics/padic_printing.pyx. I think that having a "printer object" attached to a parent, allowing for a different inheritance tree for the printing objects and more flexibility in changing print options at runtime, is a good idea.
I don't have time to work on it anytime soon, but feel fre to do so. :-) David On Fri, Jul 17, 2009 at 8:14 PM, Alex Ghitza <aghi...@gmail.com> wrote: > > Hi, > > I've been working on making the printing of polynomials prettier and > more consistent between the univariate setting and the multivariate > one. > > There is one ticket (with patch) on trac now at > > http://trac.sagemath.org/sage_trac/ticket/6551 > > which focuses on the case of exact coefficients and fixes things like > unnecessary parentheses. > > > Another issue comes up in the case of inexact coefficients. Compare these > two: > > {{{ > sage: R.<x> = RR[] > sage: x^2 - 3.2*x + 1 > 1.00000000000000*x^2 - 3.20000000000000*x + 1.00000000000000 > sage: > sage: R.<x, y> = RR[] > sage: x^2 - 3.2*x*y + y > x^2 - 3.20000000000000*x*y + y > }}} > > I'd like the second example to look more like the first and it's > pretty easy to make that happen. However, this means: > > {{{ > sage: x > 1.00000000000000*x > sage: y > 1.00000000000000*y > sage: (x^2 - y).variables() > [1.00000000000000*x, 1.00000000000000*y] > }}} > > I'm ok with the first two, but the last thing causes all sorts of > problems in many places that expect the list to be [x, y]. > > However, I'm not sure why .variables() needs to return the variables > *as elements of the polynomial ring*, as opposed to, say, strings such > as ['x', 'y']. I would be tempted to make this change, but it's > fairly drastic and needs some discussion here. > > > Best, > Alex > > -- > Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne > -- Australia -- > http://www.ms.unimelb.edu.au/~aghitza/<http://www.ms.unimelb.edu.au/%7Eaghitza/> > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---