On Saturday, June 20, 2015 at 11:55:02 AM UTC-7, Martin R wrote:
>
> Yes, that's quite clear.  _matrix_constructor determines nrows (2) and 
> ncols (3) and the ring (Symbolic Ring) and calls 
> matrix_space.MatrixSpace(ring, nrows, ncols)(entries).  This fails, since 
> entries is a single element.  But the bug is, I'd say, that 
> _matrix_constructor calls MatrixSpace with a single element.
>

What is the bug here? Do you think matrix(2,3,1) should succeed? Do you 
think it should produce a different error message? The following behaviour 
seems quite reasonable to me:

sage: MatrixSpace(ZZ,2,2)(5)
[5 0]
[0 5]
sage: MatrixSpace(ZZ,2,3)(5)
TypeError: nonzero scalar matrix must be square

Although:

sage: MatrixSpace(ZZ,2,3)(0)
[0 0 0]
[0 0 0]

suggests this should perhaps be a ValueError

I wouldn't mind if the latter would not work, since the following does:

sage: MatrixSpace(ZZ,2,3).zero()
[0 0 0]
[0 0 0]


-- 
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.

Reply via email to