Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 5137ef9

Browse files
committedAug 3, 2016
removed deprecated method getslice
1 parent ac109c8 commit 5137ef9

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed
 

‎src/sage/rings/polynomial/skew_polynomial_element.pyx

+1-29
Original file line numberDiff line numberDiff line change
@@ -462,34 +462,6 @@ cdef class SkewPolynomial(AlgebraElement):
462462
except IndexError:
463463
return self.base_ring().zero()
464464

465-
def __getslice__(self, Py_ssize_t i, Py_ssize_t j):
466-
"""
467-
Return a specific portion of ``self``.
468-
469-
.. NOTE::
470-
471-
For slices exceeding degree of polynomial, 0 is returned.
472-
473-
EXAMPLES::
474-
sage: R.<t> = QQ[]
475-
sage: sigma = R.hom([t+1])
476-
sage: S.<x> = R['x',sigma]
477-
sage: a = t*x^2 + (t + 3/7)*x + t^2
478-
sage: a[1:]
479-
t*x^2 + (t + 3/7)*x
480-
sage: a[:1]
481-
t^2
482-
sage: a[3:]
483-
0
484-
"""
485-
if i <= 0:
486-
i = 0
487-
zeros = []
488-
elif i > 0:
489-
zeros = [self._parent.base_ring().zero()] * i
490-
c = self._new_c(zeros + self._coeffs[i:j], self._parent, 1)
491-
return c
492-
493465
def __setitem__(self, n, value):
494466
"""
495467
Set the `n`-th coefficient of this skew polynomial. This always
@@ -924,7 +896,7 @@ cdef class SkewPolynomial(AlgebraElement):
924896
sage: a.truncate(3)
925897
(t + 1)*x^2
926898
"""
927-
return self[:n]
899+
return self._new_c(self[:n], self._parent, 1)
928900

929901
def is_monic(self):
930902
"""

0 commit comments

Comments
 (0)
This repository has been archived.