On May 14, 11:35 am, Volker Braun <vbraun.n...@gmail.com> wrote: > Don't do that. Exceptions should be short and to the point. And not do any > string processing. Don't convert passed values to strings unless you don't > care about performance.
I agree, but it does happen. And as you see, matrix.__repr__ takes the whole performance loss a couple of orders of magnitude further with its stack inspection thing. Would you want to consider that as a feature, to make suboptimal implementations more noticeable? Also, is it always reasonable to expect error messages to be without string processing? For instance: sage: G=matrix(20,20,[GF(3)(1)]*400) sage: G+GF(5)(1) TypeError: unsupported operand parent(s) for '+': 'Full MatrixSpace of 20 by 20 dense matrices over Finite Field of size 3' and 'Finite Field of size 5' This is the style of error message Python itself generates in these situations. Missing out on that info would be quite painful. I think someone was considering using a "lazy" object as "message" that would only materialize to a full string if it's really asked for. Did we ever get to that? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel?hl=en. For more options, visit https://groups.google.com/groups/opt_out.