On 2016-02-23 17:10, Nils Bruin wrote:
> 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.

Yes, we should try this, e.g.
  sage: 2^RIF(1.01,1.03)
would fail otherwise.

Note that almost no __pow__ uses indeed coercions; they use only
conversions. E.g.
  from integer.pyx, L 1907:
        except TypeError:
            s = parent_c(n)(self)
            return s**n
Thus, finding a common parent is not tried at all. Due to conversions
ugly things like
  sage: 7^(Zmod(3)(2))
  49
are possible.

Daniel

-- 
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.

Reply via email to