Sadly

```Python
In [1]: slice(None, None, 2).indices(n)
TypeError: 'Symbol' object cannot be interpreted as an index
```


On Fri, Feb 15, 2013 at 11:02 AM, Christopher Smith <
notifications@github.com> wrote:

> In sympy/matrices/expressions/tests/test_slice.py:
>
> > @@ -51,3 +51,10 @@ def test_symmetry():
> >      Y = X[:5, 5:]
> >      with assuming(Q.symmetric(X)):
> >          assert Y.T == X[5:, :5]
> > +
> > +def test_slice_of_slice():
> > +    X = MatrixSymbol('x', 10, 10)
> > +    assert X[2][:, 3][0, 0] == X[2, 3]
>
> yeah...let indices do your heavy lifting in normalize:
>
> >>> X[2,:][:,-3:]  # I want the last 3 columns of row 2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "sympy\matrices\expressions\matexpr.py", line 197, in __getitem__
>     return MatrixSlice(self, i, j)
>   File "sympy\matrices\expressions\slice.py", line 53, in __new__
>     raise IndexError()
> IndexError
> >>> slice(-3,None,None).indices(10)
> (7, 10, 1)
> >>> X[2,:][:,7:10]
> X[2, 7:10]
> >>> X[2][:,slice(*slice(-3,None,None).indices(10))]
> X[2, 7:10]
>
>  —
> Reply to this email directly or view it on GitHub<https://github.com/sympy/sympy/pull/1787/files#r3033367>.
>
>