#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:                     |  94784864094bc84e7eb8c977fd1cf8efc4aa9b6e
  u/jdemeyer/18940-getitem_step      |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Description changed by jdemeyer:

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.  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__()`.

New description:

 For polynomials, we implement 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__()`.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18940#comment:52>
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.

Reply via email to