title: Know whether argument passed to function is a vector or a matrix
body: <p>I'm writing a function in Sage that should work in different way for vectors and matrices.</p>
  
  <p>I can not use <code>isinstance</code> function because type of vector or matrix depends on the type of the elements:</p>
  
  <pre><code>sage: type(matrix([[1]]))
  &lt;type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'&gt;
  sage: type(matrix([[i]]))
  &lt;type 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense'&gt;
  </code></pre>
  
  <p>What is the best way to distinguish vectors and matrices?</p>