On Saturday, June 20, 2015 at 3:34:06 PM UTC-7, Martin R wrote: > > > What is the bug here? Do you think matrix(2,3,1) should succeed? Do you > think it should produce a different error message? > > No, I think that matrix(nrows, ncols, element) sould fail, unless element > is callable or iterable. >
We'd need to do serious *extra* work and checking for that. Currently, if MatrixSpace(R,n,m)(L) works then matrix(R,n,m,L) will work too. Making sure that matrix(R,n,m,L) breaks for some L where MatrixSpace succeeds would require extra testing and explicit error raising. Would that really be an improvement? To ensure that the following happens? sage: matrix(2,2,x+y) [0 1] [1 2] (assuming x+y would be recognized as callable before it is recognized as iterable)? I think the current answer is less surprising. -- 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. For more options, visit https://groups.google.com/d/optout.