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

If that gives False then that means it is implemented wrong. What does `c[1].subs(c, {1: 2})` give?