#6570: indexing a matrix with a non-integer should return an IndexError, not a
TypeError
----------------------------+-----------------------------------------------
Reporter: jason | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.1
Component: linear algebra | Keywords:
Reviewer: | Author:
Merged: |
----------------------------+-----------------------------------------------
{{{
----------------------------------------------------------------------
| Sage Version 4.1, Release Date: 2009-07-09 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: a=random_matrix(ZZ,4)
sage: a[1,1.5]
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/grout/.sage/temp/tiny/11658/_home_grout__sage_init_sage_0.py in
<module>()
/home/grout/sage/local/lib/python2.6/site-packages/sage/matrix/matrix0.so
in sage.matrix.matrix0.Matrix.__getitem__ (sage/matrix/matrix0.c:4772)()
837 else:
838 if not PyIndex_Check(col_index):
--> 839 raise TypeError, "index must be an integer"
840 col = col_index
841 if col < 0:
TypeError: index must be an integer
sage: a[1.5,1]
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/grout/.sage/temp/tiny/11658/_home_grout__sage_init_sage_0.py in
<module>()
/home/grout/sage/local/lib/python2.6/site-packages/sage/matrix/matrix0.so
in sage.matrix.matrix0.Matrix.__getitem__ (sage/matrix/matrix0.c:4487)()
811 else:
812 if not PyIndex_Check(row_index):
--> 813 raise TypeError, "index must be an integer"
814 row = row_index
815 if row < 0:
TypeError: index must be an integer
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6570>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---