A question for coercion experts: Currently we have:
sage: cm=get_coercion_model() sage: cm.explain(ZZ,QQ['t'],operator.pow) Coercion on left operand via Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Natural morphism: From: Integer Ring To: Rational Field then Polynomial base injection morphism: From: Rational Field To: Univariate Polynomial Ring in t over Rational Field Arithmetic performed after coercions. Result lives in Univariate Polynomial Ring in t over Rational Field Univariate Polynomial Ring in t over Rational Field sage: cm.explain(QQ['t'],QQ,operator.pow) Coercion on right operand via Polynomial base injection morphism: From: Rational Field To: Univariate Polynomial Ring in t over Rational Field Arithmetic performed after coercions. Result lives in Univariate Polynomial Ring in t over Rational Field Univariate Polynomial Ring in t over Rational Field so if you do sage: R.<t>=QQ[] sage: 2^t the latter gets evaluated by making coercing 2 into R and then trying to raise to an element of R (which fails). Should we even be trying this? I would think most valid cases of exponentiating are covered by actions. The cases where it can be read as a binary operation on a single structure are rare (and probably due to the structure acting on itself). (this comes up on #20086) -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.