From 418baa0ad159f028cde5bae379816b36eb99a0b6 Mon Sep 17 00:00:00 2001 From: nbruin Date: Thu, 23 Jan 2025 10:52:07 -0800 Subject: [PATCH 1/2] remove attempt to coerce scalar to basering for truediv --- src/sage/rings/polynomial/polynomial_element.pyx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx index b8445edeb20..10280e9cc82 100644 --- a/src/sage/rings/polynomial/polynomial_element.pyx +++ b/src/sage/rings/polynomial/polynomial_element.pyx @@ -2767,15 +2767,6 @@ cdef class Polynomial(CommutativePolynomial): if have_same_parent(left, right): return (left)._div_(right) - # Try division of polynomial by a scalar - if isinstance(left, Polynomial): - R = (left)._parent._base - try: - x = R.coerce(right) - return left * ~x - except TypeError: - pass - # Delegate to coercion model. The line below is basically # RingElement.__truediv__(left, right), except that it also # works if left is not of type RingElement. From a36436b0fc3c0dcee0999f2fc2d302ef9ea879df Mon Sep 17 00:00:00 2001 From: nbruin Date: Sat, 25 Jan 2025 00:34:16 -0800 Subject: [PATCH 2/2] test to see how broken _rmul_ for padic polynomials is --- .../polynomial/padics/polynomial_padic_capped_relative_dense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py index 668f66fe574..6a7fc98d12d 100644 --- a/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py +++ b/src/sage/rings/polynomial/padics/polynomial_padic_capped_relative_dense.py @@ -573,7 +573,7 @@ def _rmul_(self, left): sage: K(13,7) * a (13 + O(13^7))*t^4 + (13^2 + O(13^6))*t^2 + 13^2 + O(13^8) """ - return None + # return None #commented this out to see how broken this is # The code below has never been tested and is somehow subtly broken. if self._valaddeds is None: