Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think the problem might be that

cdef Integer z

is part of the code here, and then there is no coercion to the integers, it's just assumed that it is one. Trying

    z = Integer(row[k])

seems to fix it, though this is probably inelegant and inefficient.

Here is a minimal example inside Sage itself, for reference.

sage: m = matrix([[int(1),int(1)],[int(1),int(1)]])
sage: m.insert_row(1,[int(1),int(1)])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)