Skip to content

Commit abc6c6c

Browse files
fchapotontscrim
andauthored
let's use Travis' way
Co-authored-by: Travis Scrimshaw <[email protected]>
1 parent 4b44d45 commit abc6c6c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sage/rings/polynomial/integer_valued_polynomials.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,12 @@ def variable_shift(self, k=1):
12061206
A = self.parent()
12071207

12081208
def on_basis(n):
1209-
return A._from_dict({A._indices(j): binomial(k, n - j)
1210-
for j in range(n + 1)})
1209+
return {A._indices(j): binomial(k, n - j) for j in range(n + 1)}
12111210

1212-
return A.module_morphism(on_basis, codomain=A)(self)
1211+
from sage.data_structures.blas_dict import linear_combination
1212+
mc = self._monomial_coefficients
1213+
ret = linear_combination((on_basis((index), coeff)
1214+
for (index, coeff) in mc.items())
1215+
return A.element_class(A, ret)
12131216

12141217
B = Binomial

0 commit comments

Comments
 (0)