If you're doing a dictionary anyway, doesn't it make more sense to use **kwargs? For example,
sage: P.<x,y>=ZZ[] sage: f=x*y^2+x*y+y+x+1 sage: f.coefficient(y=2) x sage: f.coefficient(y=1) x + 1 sage: f.coefficient(x=1, y=2) 1 It takes a little bit to get used to the semantics of it, but the syntax is much more natural / Pythonic. --Mike On 10/12/07, didier deshommes <[EMAIL PROTECTED]> wrote: > > 2007/10/12, Joel B. Mohler <[EMAIL PROTECTED]>: > > sage: P.<x,y,z>=ZZ[] > > sage: f=x*y^2*z^3+y^2*z > > sage: f.coefficient(y,2,z,3) # I want the "coefficient" of y^2*z^3 > > # Bang > > > > That doesn't seem very nice to me. > > Good point: Dictionary it is then. (Incidentally, there downs seem a > non-obvious way to do this in Maple). > > didier > > > > > -- > > Joel > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---