isinstance(index, int) doesn't cover python 2.X long or the various numpy.int## cases. There's the py2help._inttypes, or Python's operator.index to help with this.