Re: [sage-devel] Coercions of polynomials

2020-01-14 Thread David Roe
On Tue, Jan 14, 2020 at 11:32 AM Travis Scrimshaw wrote: > So one thing I thought of that could be a problem is this: > > ZZ['x'] --> ZZ['x,y']['x'] > > or more generally anytime there are repeated variable names. Actually, in > this case, I feel the default should be to go into the base ring rat

Re: [sage-devel] Coercions of polynomials

2020-01-14 Thread Travis Scrimshaw
So one thing I thought of that could be a problem is this: ZZ['x'] --> ZZ['x,y']['x'] or more generally anytime there are repeated variable names. Actually, in this case, I feel the default should be to go into the base ring rather than the final ring, but another option would be to just error

Re: [sage-devel] Coercions of polynomials

2020-01-14 Thread David Roe
On Tue, Jan 14, 2020 at 2:31 AM Vincent Delecroix <20100.delecr...@gmail.com> wrote: > Maybe you want > > sage: T(S.flattening_morphism()(f)) > a*x + b*x + a*y + b*y > > > Le 14/01/2020 à 08:22, Travis Scrimshaw a écrit : > > Hi everyone, > > I wanted to know if this is a deliberate behavior o

Re: [sage-devel] Coercions of polynomials

2020-01-13 Thread Vincent Delecroix
Maybe you want sage: T(S.flattening_morphism()(f)) a*x + b*x + a*y + b*y Le 14/01/2020 à 08:22, Travis Scrimshaw a écrit : Hi everyone, I wanted to know if this is a deliberate behavior or a bug: sage: R. = ZZ[] sage: S. = R[] sage: T = ZZ['a,b,x,y'] sage: f = (x+y)*(a+b) sage: T(f) ... T

[sage-devel] Coercions of polynomials

2020-01-13 Thread Travis Scrimshaw
Hi everyone, I wanted to know if this is a deliberate behavior or a bug: sage: R. = ZZ[] sage: S. = R[] sage: T = ZZ['a,b,x,y'] sage: f = (x+y)*(a+b) sage: T(f) ... TypeError: not a constant polynomial I understand that there should not be a coercion from S to T, but I feel like we should be