#13299: Improve slice and __getitem__ methods of padics
------------------------+---------------------------------------------------
   Reporter:  saraedum  |             Owner:  roed    
       Type:  defect    |            Status:  new     
   Priority:  minor     |         Milestone:  sage-5.3
  Component:  padics    |          Keywords:          
Work issues:            |   Report Upstream:  N/A     
  Reviewers:            |           Authors:          
  Merged in:            |      Dependencies:          
   Stopgaps:            |  
------------------------+---------------------------------------------------
 There are a few surprises/bugs in the way that slices and
 {{{__getitem__}}} works for padics.

 * Slices are not supported in some cases:
 {{{
 sage: R = Zp(5, 6, 'capped-rel')
 sage: a = R(1/2); a
 3 + 2*5 + 2*5^2 + 2*5^3 + 2*5^4 + 2*5^5 + O(5^6)
 sage: a[0:5]
 ValueError: due to limitations in Python 2.5, you must call the slice()
 function rather than using the [:] syntax in this case
 }}}
 * The precision is sometimes wrong over fields:
 {{{
 sage: K = Qp(5, 6)
 sage: a = K(1/25); a
 5^-2 + O(5^4)
 sage: a.slice(2, 4)
 O(5^6)
 }}}
 * Over fields, the coefficients are sometimes wrong:
 {{{
 sage: a.slice(-5, -1)
 5^-5 + O(5)
 }}}
 * Some indices produce an error, even though they are inside the
 precision:
 {{{
 sage: a.precision_absolute()
 4
 sage: a[0]
 IndexError: list index out of range
 }}}
 * The returned values are sometimes padics
 {{{
 sage: a = K(1/5 + 5); a
 5^-1 + 5 + O(5^5)
 sage: a[-2].parent()
 5-adic Field with capped relative precision 6
 sage: a[-1].parent()
 Integer Ring
 }}}
 * They do not seem to work over unramified extensions. This will be the
 topic of a followup ticket.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13299>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to