On May 22, 6:09 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> > In fact there is no coercion around:
>
> There is a non-canonical coercion:
>
> sage: SR('x')
> xAccording to http://modular.math.washington.edu/sage/doc/html/prog/node17.html, this is *not* a (non-canonical) coercion but object creation. > var('x') == 'x' is a constructor for a symbolic equation, so it should > return a symbolic equation. I know. But http://modular.math.washington.edu/sage/doc/html/prog/node17.html also mentions the __cmp__-method, which should return -1 since there is no _coerce_ defined. sage: x.__cmp__('x') # with double underscore 0 sage: x._cmp_('x') # with single underscore 1 Compare sage: QQ(1)._cmp_(GF(7)(1)) # single underscore -1 sage: QQ(1).__cmp__(GF(7)(1)) # double underscore Traceback which shouldn't happen by Python convention! > > Is there a definition of "coercion map" and of "canonical", except the > > page http://modular.math.washington.edu/sage/doc/html/prog/node17.html? > > Yes. Namely? Simon --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
