This repository was archived by the owner on Jan 30, 2023. It is now read-only.
File tree 1 file changed +1
-29
lines changed
src/sage/rings/polynomial
1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -462,34 +462,6 @@ cdef class SkewPolynomial(AlgebraElement):
462
462
except IndexError :
463
463
return self .base_ring().zero()
464
464
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
-
493
465
def __setitem__ (self , n , value ):
494
466
"""
495
467
Set the `n`-th coefficient of this skew polynomial. This always
@@ -924,7 +896,7 @@ cdef class SkewPolynomial(AlgebraElement):
924
896
sage: a.truncate(3)
925
897
(t + 1)*x^2
926
898
"""
927
- return self [:n]
899
+ return self ._new_c( self [:n], self ._parent, 1 )
928
900
929
901
def is_monic (self ):
930
902
"""
You can’t perform that action at this time.
0 commit comments