Yes, the same for str too. And perhaps even something should be added to the pretty printer to print ellipses if there is a large block of zeros.
But first let's merge https://github.com/sympy/sympy/pull/2088 (it's too bad this wasn't merged already; now there are merge conflicts). Aaron Meurer On Mon, Jun 17, 2013 at 11:28 PM, smichr <smi...@gmail.com> wrote: > Is it worth adding a more economical printing of SparseMatrix in > printing/repr.py? > > def _print_Sparse(m): > """return shortest representation for SparseMatrix""" > o1 = m.shape[0], m.shape[1], m._smat > o2 = Matrix(m).tolist() > o3 = m.shape[0], m.shape[1], Matrix(m)._mat > l1, l2, l3 = [len(str(i)) for i in (o1, o2, o3)] > if l1 < l2 and l1 < l3: > return 'SparseMatrix(%i, %i, %s)' % o1 > if l2 < l1 and l2 < l3: > return 'SparseMatrix(%s)' % o2 > return 'SparseMatrix(%i, %i, %s)' % o3 > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at http://groups.google.com/group/sympy. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.