#18940: Simplify __getitem__ for polynomials and deprecate slicing
-------------------------------------+-------------------------------------
Reporter: pbruin | Owner:
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.10
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: Peter Bruin, | Reviewers:
Jeroen Demeyer | Work issues:
Report Upstream: N/A | Commit:
Branch: | 1c56779b3140d12fbe5d0973cdcad0ac9dbb8054
u/pbruin/18940-getitem_step | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Old description:
> For polynomials, we implementing a generic `__getitem__()` method, which
> depends on a new Cython method `get_unsafe()` to get single coefficients.
> Overall, this greatly simplifies the code. Slicing for polynomials is
> deprecated, since there is no clear use case and it is not mathematically
> well-defined what the answer should be (see also comment [comment:39] and
> further below).
>
> This fix allows us to simplify the method
> `PowerSeries_poly.__getitem__()`. Also, the patch corrects some
> (previously wrong) slice bounds in
> `LaurentPolynomial_univariate.__getitem__()`.
New description:
For polynomials, we implementing a generic `__getitem__()` method, which
depends on a new Cython method `get_unsafe()` to get single coefficients.
Overall, this greatly simplifies the code. Except for truncation
`pol[:n]`, slicing for polynomials is deprecated, since there is no clear
use case and it is not mathematically well-defined what the answer should
be (see also comment [comment:39] and further below).
This fix allows us to simplify the method
`PowerSeries_poly.__getitem__()`. Also, the patch corrects some
(previously wrong) slice bounds in
`LaurentPolynomial_univariate.__getitem__()`.
--
Comment (by jdemeyer):
Truncation is actually implemented using slicing, so we cannot easily
deprecate that.
I am working on a patch.
--
Ticket URL: <http://trac.sagemath.org/ticket/18940#comment:47>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.