On 2015-02-21, Simon King <simon.k...@uni-jena.de> wrote:
> If ZZ does not coerce into the parent of your element, then the parent
> is not a (unitary) ring.

PS:
And if it is not a ring, then many things don't work as smoothly as they
should.

For example, if P is a commutative additive group with an element x, then most
people would expect that x+0 should be equal to x. Reason: The ADDITIVE
group of ZZ coerces into P. However, Sage wants to coerce the RING ZZ
into P. It would be quite challanging to extend Sage's coercion model so
that the same parent (here: ZZ) can play different roles in coercion.

I.e., if P is a commutative additive group, then P.coerce_map_from(ZZ)
should return a morphism in the category of commutative additive groups.
Then, x+0 should work (because the coercion map is a morphism in the
category of additive groups), but x*0 should not work (because it is not
a morphism of multiplicative groups).

Best regards,
Simon


-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to