On Mar 7, 2009, at 12:17 PM, Simon King wrote: > > Hi Jason, > > On 7 Mrz., 20:51, Jason Grout <jason-s...@creativetrax.com> wrote: >> I don't know if the following error is in the vector code or the >> coercion system. It says it is a bug in coercion... >> >> --------------------------------------------------------------------- >> - >> | Sage Version 3.4.alpha0, Release Date: >> 2009-02-24 | >> | Type notebook() for the GUI, and license() for >> information. | >> --------------------------------------------------------------------- >> - >> sage: f(x,y)=x+y-1 >> sage: vector([x,y,f]) >> --------------------------------------------------------------------- >> ------ >> RuntimeError Traceback (most recent >> call last) > > I'd say this definition deserves an error being raised! > But perhaps a TypeError or ValueError might be better. > >> RuntimeError: There is a bug in the coercion code in SAGE. >> Both x (=y) and y (=(x, y) |--> y + x - 1) are supposed to have >> identical parents but they don't. > > The error message is strange/misleading. The coercion system complains > for a good reason - so why should it be a *bug* in the coercion code?
To give a bit more of the traceback > Both x (=y) and y (=(x, y) |--> y + x - 1) are supposed to have > identical parents but they don't. > In fact, x has parent 'Symbolic Ring' > whereas y has parent 'Callable function ring with arguments (x, y)' > Original elements y (parent Symbolic Ring) and (x, y) |--> y + x - > 1 (parent Callable function ring with arguments (x, y)) and maps > <type 'NoneType'> None > <type 'sage.categories.morphism.CallMorphism'> Call morphism: > From: Callable function ring with arguments (x, y) > To: Symbolic Ring This means that it tried to make f into an SR, but fails. sage: SR(f).parent() is SR False If anyone's thinking about working on this, I already have a patch to move symbolics to the new coercion model, but it needs to be rebased against 3.4. - Robert --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---