summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2017-06-06 20:33:11 +0200
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2017-06-06 22:28:03 +0200
commit8f294308f8b85b233ffdc9df3f20c404ee6431c9 (patch)
tree1ec485bb841f1a370a2ccd62d48ab3e0fc4e7cac
parentUpdated SageMath version to 8.0.beta9 (diff)
_lmul_ and _rmul_: scalar should be Element instead of RingElement
-rw-r--r--src/sage/algebras/letterplace/free_algebra_element_letterplace.pxd5
-rw-r--r--src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx4
-rw-r--r--src/sage/algebras/quatalg/quaternion_algebra_element.pyx4
-rw-r--r--src/sage/interfaces/gap.py5
-rw-r--r--src/sage/matrix/matrix0.pyx5
-rw-r--r--src/sage/matrix/matrix_cyclo_dense.pyx2
-rw-r--r--src/sage/matrix/matrix_gf2e_dense.pyx2
-rw-r--r--src/sage/matrix/matrix_gfpn_dense.pyx2
-rw-r--r--src/sage/matrix/matrix_integer_dense.pyx3
-rw-r--r--src/sage/matrix/matrix_integer_sparse.pyx2
-rw-r--r--src/sage/matrix/matrix_modn_dense_template.pxi2
-rw-r--r--src/sage/matrix/matrix_rational_dense.pyx2
-rw-r--r--src/sage/matrix/matrix_rational_sparse.pyx2
-rw-r--r--src/sage/matrix/matrix_sparse.pyx2
-rw-r--r--src/sage/modular/pollack_stevens/dist.pyx2
-rw-r--r--src/sage/modules/free_module_element.pyx8
-rw-r--r--src/sage/modules/vector_double_dense.pyx5
-rw-r--r--src/sage/modules/vector_integer_dense.pyx4
-rw-r--r--src/sage/modules/vector_mod2_dense.pyx2
-rw-r--r--src/sage/modules/vector_modn_dense.pyx2
-rw-r--r--src/sage/modules/vector_rational_dense.pyx5
-rw-r--r--src/sage/modules/with_basis/indexed_element.pxd4
-rw-r--r--src/sage/modules/with_basis/indexed_element.pyx4
-rw-r--r--src/sage/numerical/linear_functions.pyx2
-rw-r--r--src/sage/numerical/linear_tensor_element.pyx4
-rw-r--r--src/sage/quivers/algebra_elements.pyx4
-rw-r--r--src/sage/rings/laurent_series_ring_element.pyx4
-rw-r--r--src/sage/rings/number_field/number_field_element_quadratic.pyx11
-rw-r--r--src/sage/rings/polynomial/laurent_polynomial.pyx8
-rw-r--r--src/sage/rings/polynomial/multi_polynomial_libsingular.pyx2
-rw-r--r--src/sage/rings/polynomial/pbori.pyx2
-rw-r--r--src/sage/rings/polynomial/plural.pyx2
-rw-r--r--src/sage/rings/polynomial/polynomial_element.pyx8
-rw-r--r--src/sage/rings/polynomial/polynomial_integer_dense_flint.pyx7
-rw-r--r--src/sage/rings/polynomial/polynomial_integer_dense_ntl.pyx8
-rw-r--r--src/sage/rings/polynomial/polynomial_modn_dense_ntl.pyx10
-rw-r--r--src/sage/rings/polynomial/polynomial_rational_flint.pyx4
-rw-r--r--src/sage/rings/polynomial/polynomial_real_mpfr_dense.pyx2
-rw-r--r--src/sage/rings/polynomial/polynomial_template.pxi2
-rw-r--r--src/sage/rings/polynomial/polynomial_zz_pex.pyx2
-rw-r--r--src/sage/rings/polynomial/skew_polynomial_element.pyx4
-rw-r--r--src/sage/rings/power_series_mpoly.pyx4
-rw-r--r--src/sage/rings/power_series_pari.pyx4
-rw-r--r--src/sage/rings/power_series_poly.pyx4
-rw-r--r--src/sage/structure/coerce_actions.pyx31
-rw-r--r--src/sage/structure/element.pxd4
-rw-r--r--src/sage/structure/element.pyx4
47 files changed, 106 insertions, 109 deletions
diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pxd b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pxd
index 1304fd5..fa7df06 100644
--- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pxd
+++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pxd
@@ -7,12 +7,9 @@
#
###############################################################################
-cdef class FreeAlgebraElement_letterplace
-
-from sage.structure.element cimport AlgebraElement, ModuleElement, RingElement, Element
+from sage.structure.element cimport AlgebraElement, ModuleElement, Element
from sage.rings.polynomial.multi_polynomial_libsingular cimport MPolynomialRing_libsingular, MPolynomial_libsingular
from sage.algebras.letterplace.free_algebra_letterplace cimport FreeAlgebra_letterplace
cdef class FreeAlgebraElement_letterplace(AlgebraElement):
cdef MPolynomial_libsingular _poly
-
diff --git a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
index 219c355..9e29154 100644
--- a/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
+++ b/src/sage/algebras/letterplace/free_algebra_element_letterplace.pyx
@@ -555,7 +555,7 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
right._poly = A._current_ring(right._poly)
return FreeAlgebraElement_letterplace(self._parent,self._poly-right._poly,check=False)
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
Multiplication from the right with an element of the base ring.
@@ -569,7 +569,7 @@ cdef class FreeAlgebraElement_letterplace(AlgebraElement):
"""
return FreeAlgebraElement_letterplace(self._parent,self._poly._lmul_(right),check=False)
- cpdef _rmul_(self, RingElement left):
+ cpdef _rmul_(self, Element left):
"""
Multiplication from the left with an element of the base ring.
diff --git a/src/sage/algebras/quatalg/quaternion_algebra_element.pyx b/src/sage/algebras/quatalg/quaternion_algebra_element.pyx
index a891280..09d59c2 100644
--- a/src/sage/algebras/quatalg/quaternion_algebra_element.pyx
+++ b/src/sage/algebras/quatalg/quaternion_algebra_element.pyx
@@ -524,7 +524,7 @@ cdef class QuaternionAlgebraElement_abstract(AlgebraElement):
"""
return ~self.reduced_norm() * self.conjugate()
- cpdef _rmul_(self, RingElement left):
+ cpdef _rmul_(self, Element left):
"""
Return left*self, where left is in the base ring.
@@ -538,7 +538,7 @@ cdef class QuaternionAlgebraElement_abstract(AlgebraElement):
"""
return self.__class__(self._parent, (left*self[0], left*self[1], left*self[2], left*self[3]), check=False)
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
Return self*right, where right is in the base ring.
diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py
index 4699c54..a828699 100644
--- a/src/sage/interfaces/gap.py
+++ b/src/sage/interfaces/gap.py
@@ -185,6 +185,7 @@ from sage.misc.superseded import deprecation
from sage.misc.cachefunc import cached_method
from sage.docs.instancedoc import instancedoc
from sage.interfaces.tab_completion import ExtraTabCompletion
+from sage.structure.element import ModuleElement
import re
import os
import pexpect
@@ -963,8 +964,10 @@ class Gap_generic(ExtraTabCompletion, Expect):
return self('%s.%s' % (record.name(), name))
+# We need to inherit from ModuleElement to support
+# sage.structure.coerce_actions.ModuleAction
@instancedoc
-class GapElement_generic(ExtraTabCompletion, ExpectElement):
+class GapElement_generic(ModuleElement, ExtraTabCompletion, ExpectElement):
r"""
Generic interface to the GAP3/GAP4 interpreters.
diff --git a/src/sage/matrix/matrix0.pyx b/src/sage/matrix/matrix0.pyx
index 762cb64..7ca5c00 100644
--- a/src/sage/matrix/matrix0.pyx
+++ b/src/sage/matrix/matrix0.pyx
@@ -4830,8 +4830,7 @@ cdef class Matrix(sage.structure.element.Matrix):
"""
return self.change_ring(self._base_ring.quotient_ring(p))
-
- cpdef _rmul_(self, RingElement left):
+ cpdef _rmul_(self, Element left):
"""
EXAMPLES::
@@ -4868,7 +4867,7 @@ cdef class Matrix(sage.structure.element.Matrix):
ans.set_unsafe(r, c, x * self.get_unsafe(r, c))
return ans
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
EXAMPLES:
diff --git a/src/sage/matrix/matrix_cyclo_dense.pyx b/src/sage/matrix/matrix_cyclo_dense.pyx
index e598561..b54fa78 100644
--- a/src/sage/matrix/matrix_cyclo_dense.pyx
+++ b/src/sage/matrix/matrix_cyclo_dense.pyx
@@ -559,7 +559,7 @@ cdef class Matrix_cyclo_dense(matrix_dense.Matrix_dense):
A._matrix = self._matrix - (<Matrix_cyclo_dense>right)._matrix
return A
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
Multiply a dense cyclotomic matrix by a scalar.
diff --git a/src/sage/matrix/matrix_gf2e_dense.pyx b/src/sage/matrix/matrix_gf2e_dense.pyx
index 5de99b5..43bf47b 100644
--- a/src/sage/matrix/matrix_gf2e_dense.pyx
+++ b/src/sage/matrix/matrix_gf2e_dense.pyx
@@ -633,7 +633,7 @@ cdef class Matrix_gf2e_dense(matrix_dense.Matrix_dense):
sig_off()
return ans
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
Return ``a*B`` for ``a`` an element of the base field.
diff --git a/src/sage/matrix/matrix_gfpn_dense.pyx b/src/sage/matrix/matrix_gfpn_dense.pyx
index ef8a070..345474e 100644
--- a/src/sage/matrix/matrix_gfpn_dense.pyx
+++ b/src/sage/matrix/matrix_gfpn_dense.pyx
@@ -1112,7 +1112,7 @@ cdef class Matrix_gfpn_dense(Matrix_dense):
raise ValueError("The matrix must not be empty")
return self._lmul_(self._base_ring(-1))
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
EXAMPLES::
diff --git a/src/sage/matrix/matrix_integer_dense.pyx b/src/sage/matrix/matrix_integer_dense.pyx
index 9c374e1..2bf7dad 100644
--- a/src/sage/matrix/matrix_integer_dense.pyx
+++ b/src/sage/matrix/matrix_integer_dense.pyx
@@ -871,8 +871,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
sig_off()
return M
-
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
EXAMPLES::
diff --git a/src/sage/matrix/matrix_integer_sparse.pyx b/src/sage/matrix/matrix_integer_sparse.pyx
index bd4e0a0..4f9cadc 100644
--- a/src/sage/matrix/matrix_integer_sparse.pyx
+++ b/src/sage/matrix/matrix_integer_sparse.pyx
@@ -184,7 +184,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse):
# def _multiply_classical(left, matrix.Matrix _right):
# def _list(self):
- cpdef _lmul_(self, RingElement right):
+ cpdef _lmul_(self, Element right):
"""
EXAMPLES::
diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
index 5b12c64..092600d 100644
--- a/src/sage/matrix/matrix_modn_dense_template.pxi
+++ b/src/sage/matrix/matrix_modn_dense_template.pxi
@@ -865,7 +865,7 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
sig_off()
return M
- cpdef _lmul_(self, RingElement left):
+ cpdef _lmul_(self, Element left):
"""
EXAMPLES::
diff --git a/src/sage/matrix/matrix_rational_dense.pyx b/src/sage/matrix/matrix_rational_dense.pyx
index 96000f3..a72b88d 100644
--- a/src/sage/matrix/matrix_rational_dense.pyx
+++ b/src/sage/matrix/matrix_rational_dense.pyx
@@ -422,7 +422,7 @@ cdef class Matrix_rational_dense(Matrix_dense):
# * _dict -- sparse dictionary of underlying elements (need not be a copy)
#################################