Hi,

Below is a passage in the Reference manual on the coercion model:

If R is the base of S (as in the first example), simply implement
_rmul_ and/or _lmul_ on the Elements of S. In this case r * s gets
handled as s._rmul_(r) and s * r as s._lmul_(r). The argument to
_rmul_ and _lmul_ are guaranteed to be Elements of the base of S (with
coercion happening beforehand if necessary).

The second sentence seems wrong. "rmul" and "lmul" seems reversed. Am
I right? or am I confused? At least, the following docs are
inconsistent with the sentence.

sage: r=1/2; parent(r)
Rational Field
sage: P.<x>=QQ[x]
sage: s=1/2*x;parent(s)
Univariate Polynomial Ring in x over Rational Field
sage: s._rmul_?
...
Definition:     s._rmul_(self, right)
Docstring:
    File: sage/rings/polynomial/polynomial_rational_flint.pyx
(starting at
    line 933)

       Returns self * right, where right is a rational number.

...
sage: s._lmul_?
...
Definition:     s._lmul_(self, right)
Docstring:
    File: sage/rings/polynomial/polynomial_rational_flint.pyx
(starting at
    line 913)

       Returns right times self, where right is a rational number.


-- 
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
URL: http://www.sagemath.org

Reply via email to