Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can do this:

sage: from sage.matrix.matrix import is_Matrix
sage: is_Matrix(1)
False

Even better, don't check for types in your code. If an argument behaves like a matrix, then your code works. If not, an exception will be raised. Thats how its supposed to work.