Consider the following:

sage: R.<x,y> = QQ[] 
....: p = x + y 
....: print(parent(p.subs(x=1))) 
....: print(parent(p.subs(x=1, y=2))) 
....: print(parent(p(x=1))) 
....: print(parent(p(x=1, y=2))) 
....: print(parent(p(1, 2))) 
....: print() 
....: R.<x,y> = QQ["a"][] 
....: p = x + y 
....: print(parent(p.subs(x=1))) 
....: print(parent(p.subs(x=1, y=2))) 
....: print(parent(p(x=1))) 
....: print(parent(p(x=1, y=2))) 
....: print(parent(p(1, 2))) 
Multivariate Polynomial Ring in x, y over Rational Field
Multivariate Polynomial Ring in x, y over Rational Field
Multivariate Polynomial Ring in x, y over Rational Field
Multivariate Polynomial Ring in x, y over Rational Field
Rational Field

Multivariate Polynomial Ring in x, y over Univariate Polynomial Ring in a 
over Rational Field
Univariate Polynomial Ring in a over Rational Field
Multivariate Polynomial Ring in x, y over Univariate Polynomial Ring in a 
over Rational Field
Univariate Polynomial Ring in a over Rational Field
Univariate Polynomial Ring in a over Rational Field

It seems to me that when a tuple of values is provided for all variables, 
the result is expected to be the polynomial evaluation and should live in 
the base ring. But if named substitutions are used, the result is going to 
be a polynomial of the same ring, even if it happens to be a constant for 
some reason. If that is not the case, one has to write different code to 
treat evaluations. So I'd say that the first ring here behaves well and the 
second one does not. What do you think?

Thank you!
Andrey

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/70ebd34f-0748-4472-a4db-d538fc896a96n%40googlegroups.com.

Reply via email to