Comment #3 on issue 3401 by [email protected]: Slicing an empty matrix is broken
http://code.google.com/p/sympy/issues/detail?id=3401

It should fail: you can't request a 0 element if there are no elements there, e.g.
[][0] fails, too.

The following doesn't fail, however:

Matrix(0,3,[])[:,:]
[]
Matrix(1,3,range(3))[0,0]
0
Matrix(1,3,range(3))[:,0]
[0]

The behavior or ":" when applied to a sequence of length 0 is Python-consistent:


slice(None,None).indices(0)
(0, 0, 1)
slice(None,None).indices(1)
(0, 1, 1)
slice(None,None).indices(10)
(0, 10, 1)

I would mark this as WontFix, but I'll leave it open for further comment.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to