added type check to look for objects with _getitem_ Fixes #7985

``` python
>>> c[1].subs(c, {1: 2})
{1: 2}[1]
>>> {1: 2}[1]
2
```
```{1: 2}[1]``` is effectively an integer.