#18158: `__getitem__` for libGap_Element
--------------------------+----------------------------
   Reporter:  vdelecroix  |            Owner:
       Type:  defect      |           Status:  new
   Priority:  critical    |        Milestone:  sage-6.6
  Component:  interfaces  |         Keywords:
  Merged in:              |          Authors:
  Reviewers:              |  Report Upstream:  N/A
Work issues:              |           Branch:
     Commit:              |     Dependencies:
   Stopgaps:              |
--------------------------+----------------------------
 There are two issue with `__getitem__` on gap vs libgap elements:
  - gap indices start with `1`. This is respected with the gap interface
 but not with the libgap interface
  - most libgap elements lacks a `__getitem__`

 Compare:
 {{{
 sage: irr = libgap.Irr(libgap.CharacterTable(S))
 sage: irr[0]
 Character( CharacterTable( Sym( [ 1 .. 10 ] ) ), [ 1, -1, 1, -1, 1, -1, 1,
 -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1,
 -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1 ] )
 sage: irr[0][0]
 Traceback (most recent call last):
 ...
 TypeError: 'sage.libs.gap.element.GapElement' object has no attribute
 '__getitem__'
 }}}
 with
 {{{
 sage: irr = gap.Irr(gap.CharacterTable(S))
 sage: irr[1]
 Character( CharacterTable( SymmetricGroup( [ 1 .. 10 ] ) ),
 [ 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1,
 1,
   -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1 ] )
 sage: irr[1][1]
 1
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18158>
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